Add two initial templates

This commit is contained in:
Luc Perkins 2022-07-12 01:17:54 +02:00
commit 72e8fcfeeb
No known key found for this signature in database
GPG key ID: 4F102D0C16E232F2
6 changed files with 188 additions and 0 deletions

9
README.md Normal file
View file

@ -0,0 +1,9 @@
# Nix flake templates for easy dev environments
```shell
# Go 1.17
nix flake init --template github:the-nix-way/dev-templates go_1_17
# Go 1.18
nix flake init --template github:the-nix-way/dev-templates go_1_18
```

17
flake.nix Normal file
View file

@ -0,0 +1,17 @@
{
description = "Ready-made templates for easily creating flake-driven environments";
outputs = { self }: {
templates = {
go_1_17 = {
path = ./go1.17;
description = "Go 1.17 development environment";
};
go_1_18 = {
path = ./go1.18;
description = "Go 1.18 development environment";
};
};
};
}

42
go1.17/flake.lock Normal file
View file

@ -0,0 +1,42 @@
{
"nodes": {
"flake-utils": {
"locked": {
"lastModified": 1656928814,
"narHash": "sha256-RIFfgBuKz6Hp89yRr7+NR5tzIAbn52h8vT6vXkYjZoM=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "7e2a3b3dfd9af950a856d66b0a7d01e3c18aa249",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1657577542,
"narHash": "sha256-tJnYrGTswnCtz8hXR24y4sZ7d+kgZ7UshnFBcrDjFkU=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "0a1978fbe48b8bd08be138507e9dade26e5778b8",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

39
go1.17/flake.nix Normal file
View file

@ -0,0 +1,39 @@
{
description = "Go 1.17 development environment";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
in {
devShells = {
default = pkgs.mkShellNoCC {
buildInputs = with pkgs; [
# go 1.17.1
go
# goimports, godoc, etc.
gotools
# https://github.com/golangci/golangci-lint
golangci-lint
# The Go language server (for IDEs and such)
gopls
# https://pkg.go.dev/github.com/ramya-rao-a/go-outline
go-outline
# https://github.com/uudashr/gopkgs
gopkgs
];
};
};
}
);
}

42
go1.18/flake.lock Normal file
View file

@ -0,0 +1,42 @@
{
"nodes": {
"flake-utils": {
"locked": {
"lastModified": 1656928814,
"narHash": "sha256-RIFfgBuKz6Hp89yRr7+NR5tzIAbn52h8vT6vXkYjZoM=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "7e2a3b3dfd9af950a856d66b0a7d01e3c18aa249",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1657577542,
"narHash": "sha256-tJnYrGTswnCtz8hXR24y4sZ7d+kgZ7UshnFBcrDjFkU=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "0a1978fbe48b8bd08be138507e9dade26e5778b8",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

39
go1.18/flake.nix Normal file
View file

@ -0,0 +1,39 @@
{
description = "Go 1.17 development environment";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
in {
devShells = {
default = pkgs.mkShellNoCC {
buildInputs = with pkgs; [
# go 1.18.3
go_1_18
# goimports, godoc, etc.
gotools
# https://github.com/golangci/golangci-lint
golangci-lint
# The Go language server (for IDEs and such)
gopls
# https://pkg.go.dev/github.com/ramya-rao-a/go-outline
go-outline
# https://github.com/uudashr/gopkgs
gopkgs
];
};
};
}
);
}