mirror of
https://github.com/danielmiessler/Fabric.git
synced 2026-01-07 21:44:02 -05:00
## CHANGES - Add GOTOOLCHAIN=local to shell environment - Configure preBuild hook in fabric package - Wrap goimports with local toolchain setting - Wrap gofmt with local toolchain setting - Update treefmt module import structure - Add pkgs parameter to treefmt config - Create shell script wrappers for Go tools
33 lines
618 B
Nix
33 lines
618 B
Nix
{
|
|
pkgs,
|
|
gomod2nix,
|
|
goEnv,
|
|
goVersion,
|
|
}:
|
|
|
|
{
|
|
default = pkgs.mkShell {
|
|
nativeBuildInputs = [
|
|
goVersion
|
|
pkgs.gopls
|
|
pkgs.gotools
|
|
pkgs.go-tools
|
|
pkgs.goimports-reviser
|
|
gomod2nix
|
|
goEnv
|
|
|
|
(pkgs.writeShellScriptBin "update-mod" ''
|
|
go get -u
|
|
go mod tidy
|
|
gomod2nix generate --outdir nix/pkgs/fabric
|
|
'')
|
|
];
|
|
|
|
shellHook = ''
|
|
export GOTOOLCHAIN=local
|
|
echo -e "\033[0;32;4mHelper commands:\033[0m"
|
|
echo "'update-mod' instead of 'go get -u && go mod tidy && gomod2nix generate --outdir nix/pkgs/fabric'"
|
|
'';
|
|
};
|
|
}
|