aboutsummaryrefslogtreecommitdiff
path: root/nixos/modules
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2022-12-04 21:39:25 +0100
committerKarel Kočí <cynerd@email.cz>2022-12-04 21:39:25 +0100
commit9996cca17aeb63ed0d51d59d4572dced0b050aee (patch)
treec8be1113f1557fd314378193798809926011e2b5 /nixos/modules
parent03151e48368bdf45ccae8ae1997e41d046c2bbdd (diff)
downloadnixos-personal-9996cca17aeb63ed0d51d59d4572dced0b050aee.tar.gz
nixos-personal-9996cca17aeb63ed0d51d59d4572dced0b050aee.tar.bz2
nixos-personal-9996cca17aeb63ed0d51d59d4572dced0b050aee.zip
install.sh: add ability to install non-native architecture
The result is that it now requires to be run only on NixOS but that should be fine.
Diffstat (limited to 'nixos/modules')
-rw-r--r--nixos/modules/compile.nix20
1 files changed, 19 insertions, 1 deletions
diff --git a/nixos/modules/compile.nix b/nixos/modules/compile.nix
index 6c42951..ffa339f 100644
--- a/nixos/modules/compile.nix
+++ b/nixos/modules/compile.nix
@@ -17,7 +17,25 @@ with lib;
max-jobs = 32;
cores = 0;
};
- boot.binfmt.emulatedSystems = [ "armv7l-linux" "aarch64-linux" ];
+ boot.binfmt.registrations = {
+ aarch64-linux = {
+ fixBinary = true;
+ wrapInterpreterInShell = false;
+ interpreter = (lib.systems.elaborate { system = "aarch64-linux"; }).emulator pkgs;
+ magicOrExtension = "\\x7fELF\\x02\\x01\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\xb7\\x00";
+ mask = "\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x00\\xff\\xff\\xff\\xff\\xff\\xff\\x00\\xff\\xfe\\xff\\xff\\xff";
+ };
+ armv7l-linux = {
+ fixBinary = true;
+ wrapInterpreterInShell = false;
+ interpreter = (lib.systems.elaborate { system = "armv7l-linux"; }).emulator pkgs;
+ magicOrExtension = "\\x7fELF\\x01\\x01\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x28\\x00";
+ mask = "\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x00\\xff\\xff\\xff\\xff\\xff\\xff\\x00\\xff\\xfe\\xff\\xff\\xff";
+ };
+ };
+ nix.settings.extra-platforms = [
+ "aarch64-linux" "armv7l-linux"
+ ];
environment.systemPackages = with pkgs; [
# Tools