diff --git a/builder/default.nix b/builder/default.nix index 5131fd3..e55d6c6 100644 --- a/builder/default.nix +++ b/builder/default.nix @@ -8,6 +8,7 @@ , jq , cacert , pkgs +, pkgsBuildBuild }: let @@ -18,9 +19,10 @@ let # Internal only build-time attributes internal = let - mkInternalPkg = name: src: pkgs.runCommand "gomod2nix-${name}" + mkInternalPkg = name: src: pkgsBuildBuild.runCommand "gomod2nix-${name}" { - nativeBuildInputs = [ pkgs.go ]; + inherit (pkgsBuildBuild.go) GOOS GOARCH; + nativeBuildInputs = [ pkgsBuildBuild.go ]; } '' export HOME=$(mktemp -d) cp ${src} src.go diff --git a/default.nix b/default.nix index 6d4a0bf..7c5e96d 100644 --- a/default.nix +++ b/default.nix @@ -20,7 +20,7 @@ buildGoApplication { nativeBuildInputs = [ makeWrapper installShellFiles ]; - postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.targetPlatform) '' + postInstall = lib.optionalString (stdenv.buildPlatform == stdenv.targetPlatform) '' $out/bin/gomod2nix completion bash > gomod2nix.bash $out/bin/gomod2nix completion fish > gomod2nix.fish $out/bin/gomod2nix completion zsh > _gomod2nix