diff --git a/machines/loki/configuration.nix b/machines/loki/configuration.nix index 25d908f..4c73eab 100644 --- a/machines/loki/configuration.nix +++ b/machines/loki/configuration.nix @@ -51,6 +51,7 @@ in }; nix-common = { enable = true; + cross-systems = [ "aarch64-linux" ]; }; tablet.enable = false; sound.enable = true; diff --git a/modules/nix-common/default.nix b/modules/nix-common/default.nix index eec70a6..0fca52d 100644 --- a/modules/nix-common/default.nix +++ b/modules/nix-common/default.nix @@ -8,8 +8,13 @@ with lib; let in { options.eboskma.nix-common = { - enable = mkEnableOption "activate nix-common"; - remote-builders = mkEnableOption "enable remote builders"; + enable = mkEnableOption "nix-common"; + remote-builders = mkEnableOption "remote builders"; + cross-systems = mkOption { + description = "list of systems to cross compile for"; + type = with types; listOf str; + default = []; + }; }; imports = [ @@ -31,7 +36,7 @@ in buildMachines = mkIf cfg.remote-builders [ { hostName = "loki"; - systems = [ "x86_64-linux" ]; + systems = [ "x86_64-linux" ] ++ cfg.cross-systems; maxJobs = 8; speedFactor = 2; supportedFeatures = [ "kvm" "big-parallel" "nixos-test" "benchmark" ]; @@ -61,6 +66,8 @@ in }; }; + boot.binfmt.emulatedSystems = cfg.cross-systems; + programs.ssh.extraConfig = mkIf cfg.remote-builders '' Host loki HostName 10.0.0.4