Fix Go compiler missing from mkGoEnv created environments

Closes #68
This commit is contained in:
adisbladis 2022-08-23 21:08:56 +08:00
parent b8c2216317
commit bca2a1231e
3 changed files with 12 additions and 6 deletions

View file

@ -170,7 +170,7 @@ let
dontConfigure = true;
dontInstall = true;
propagatedNativeBuildInputs = [ go ];
propagatedBuildInputs = [ go ];
GO_NO_VENDOR_CHECKS = "1";

View file

@ -12,10 +12,10 @@
pkgs.mkShell {
NIX_PATH = "nixpkgs=${builtins.toString pkgs.path}";
buildInputs = [
nativeBuildInputs = [
pkgs.nixpkgs-fmt
pkgs.gomod2nix.go
pkgs.gomod2nix
pkgs.golangci-lint
pkgs.gomod2nix
(pkgs.mkGoEnv { pwd = ./.; })
];
}

View file

@ -1,15 +1,21 @@
{ runCommand, mkGoEnv }:
{ runCommand, mkGoEnv, which }:
let
env = mkGoEnv {
pwd = ./.;
};
in
runCommand "mkgoenv-assert" { } ''
runCommand "mkgoenv-assert"
{
nativeBuildInputs = [ which ];
buildInputs = [ env ]; # Trigger propagation
} ''
if ! test -f ${env}/bin/stringer; then
echo "stringer command not found in env!"
exit 1
fi
which go > /dev/null || echo "Go compiler not found in env!"
ln -s ${env} $out
''