Collection of nix flake templates

go: add template for golang

yemou.pink 3d2a5bad 79e44f92

verified
Changed files
+26 -1
go
+1 -1
flake.nix
···
description = "generic nix flake";
};
}
-
// nixpkgs.lib.genAttrs [ "erlang" "python" ] (language: {
path = ./${language};
description = "${language} nix flake";
});
···
description = "generic nix flake";
};
}
+
// nixpkgs.lib.genAttrs [ "erlang" "go" "python" ] (language: {
path = ./${language};
description = "${language} nix flake";
});
+25
go/flake.nix
···
···
+
{
+
description = "TODO: Describe the flake";
+
+
inputs.nixpkgs.url = "github:NixOS/nixpkgs?ref=nixos-unstable";
+
+
outputs =
+
{ self, nixpkgs }:
+
let
+
systems = [ "x86_64-linux" ];
+
forSystems = func: nixpkgs.lib.genAttrs systems (system: func (import nixpkgs { inherit system; }));
+
in
+
{
+
formatter = forSystems (pkgs: pkgs.nixfmt-tree.override { settings.formatter.nixfmt.options = [ "-w 120" ]; });
+
+
devShells = forSystems (pkgs: {
+
default = pkgs.mkShell {
+
buildInputs = with pkgs; [
+
go
+
gopls
+
gotools
+
];
+
};
+
});
+
};
+
}