gomod2nix/tests/mkgoenv/default.nix

22 lines
384 B
Nix
Raw Normal View History

{ runCommand, mkGoEnv, which }:
2022-06-13 12:06:45 +00:00
let
env = mkGoEnv {
pwd = ./.;
};
in
runCommand "mkgoenv-assert"
{
nativeBuildInputs = [ which ];
buildInputs = [ env ]; # Trigger propagation
} ''
2022-06-13 12:06:45 +00:00
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!"
2022-06-13 12:06:45 +00:00
ln -s ${env} $out
''