2022-08-20 14:54:34 +02:00
|
|
|
{
|
|
|
|
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
|
|
|
|
goVersion = 19;
|
|
|
|
overlays = [ (self: super: { go = super."go_1_${toString goVersion}"; }) ];
|
|
|
|
pkgs = import nixpkgs { inherit overlays system; };
|
|
|
|
in
|
|
|
|
{
|
2022-10-12 23:42:34 +02:00
|
|
|
devShells.default = pkgs.mkShellNoCC {
|
2023-02-15 01:20:41 +01:00
|
|
|
packages = with pkgs; [
|
2022-10-12 23:42:34 +02:00
|
|
|
# go 1.19 (specified by overlay)
|
2022-08-20 14:54:34 +02:00
|
|
|
go
|
|
|
|
|
|
|
|
# goimports, godoc, etc.
|
|
|
|
gotools
|
|
|
|
|
|
|
|
# https://github.com/golangci/golangci-lint
|
|
|
|
golangci-lint
|
|
|
|
];
|
|
|
|
|
|
|
|
shellHook = ''
|
|
|
|
${pkgs.go}/bin/go version
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
});
|
|
|
|
}
|