dev-templates/go1.17/flake.nix

45 lines
1 KiB
Nix
Raw Normal View History

2022-07-12 01:17:54 +02:00
{
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
];
2022-07-16 16:48:23 +02:00
shellHook = ''
echo "Entering Go env"
echo "Running `${pkgs.go}/bin/go version`"
'';
2022-07-12 01:17:54 +02:00
};
};
}
);
2022-07-16 16:48:23 +02:00
}