dev-templates/go1.17/flake.nix
Luc Perkins bf45826289
fmt
2022-08-20 14:47:43 +03:00

43 lines
944 B
Nix

{
description = "A Nix-flake-based Go 1.17 development environment";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:NixOS/nixpkgs";
};
outputs = { self, flake-utils, nixpkgs }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
goPkg = pkgs.go_1_17;
inherit (pkgs) mkShellNoCC;
in
{
apps.default = {
type = "app";
program = "${goPkg}/bin/go";
};
devShells = {
default = mkShellNoCC {
buildInputs = with pkgs; [
# go 1.17.1
goPkg
# goimports, godoc, etc.
gotools
# https://github.com/golangci/golangci-lint
golangci-lint
];
shellHook = ''
${goPkg}/bin/go version
'';
};
};
});
}