Merge pull request #57 from adisbladis/cross-fix

Fix cross compilation
This commit is contained in:
adisbladis 2022-06-14 05:46:36 +08:00 committed by GitHub
commit 60a67aaa2d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View file

@ -8,6 +8,7 @@
, jq , jq
, cacert , cacert
, pkgs , pkgs
, pkgsBuildBuild
}: }:
let let
@ -18,9 +19,10 @@ let
# Internal only build-time attributes # Internal only build-time attributes
internal = internal =
let 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) export HOME=$(mktemp -d)
cp ${src} src.go cp ${src} src.go

View file

@ -20,7 +20,7 @@ buildGoApplication {
nativeBuildInputs = [ makeWrapper installShellFiles ]; 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 bash > gomod2nix.bash
$out/bin/gomod2nix completion fish > gomod2nix.fish $out/bin/gomod2nix completion fish > gomod2nix.fish
$out/bin/gomod2nix completion zsh > _gomod2nix $out/bin/gomod2nix completion zsh > _gomod2nix