Created
June 20, 2021 18:12
-
-
Save fiksn/c7f1b3004fc962679ccb7132712c729e to your computer and use it in GitHub Desktop.
Nix cross building
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Not NixOS has trouble (with non-interactive ssh) | |
export NIX_SSHOPTS="-q source ~/.profile 2>/dev/null;" | |
nix ping-store --store ssh://server && echo ok | |
# trusted-users in nix.conf | |
cat /etc/nix/nix.conf | |
sudo launchctl stop org.nixos.nix-daemon ; sudo launchctl start org.nixos.nix-daemon | |
bash $(nix-build '<nixpkgs>' -A gnu-config)/config.guess | |
# $ nix build '(with import <nixpkgs> { system = "x86_64-linux"; }; runCommand "foo" {} "uname > $out")' | |
# [25 copied (53.5 MiB), 11.9 MiB DL] | |
# error: a 'x86_64-linux' with features {} is required to build '/nix/store/izq6s2qrb2x3wbdqbm9ihrky7d88md0q-foo.drv', but I am a 'x86_64-darwin' with | |
# features {benchmark, big-parallel, nixos-test} | |
nix build '(with import <nixpkgs> { system = "x86_64-linux"; }; runCommand "foo" {} "uname > $out")' --builders 'ssh://server' -j0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment