From a5812ff83c0d5e8b5af40cf188929a5a393d77c6 Mon Sep 17 00:00:00 2001 From: Ethan Turkeltaub Date: Wed, 22 Nov 2023 18:05:13 -0500 Subject: [PATCH 1/3] Add `nix.linux-builder.systems` option to set corresponding `nix.buildMachines.*.systems` option --- modules/nix/linux-builder.nix | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/modules/nix/linux-builder.nix b/modules/nix/linux-builder.nix index da8d7910..b5ba0191 100644 --- a/modules/nix/linux-builder.nix +++ b/modules/nix/linux-builder.nix @@ -57,6 +57,22 @@ in ''; }; + systems = mkOption { + type = types.listOf types.str; + default = [ ]; + example = literalExpression '' + [ + "x86_64-linux" + "aarch64-linux" + ] + ''; + description = '' + This option specifies system types the build machine can execute derivations on. + + This sets the corresponding `nix.buildMachines.*.systems` option. + ''; + }; + maxJobs = mkOption { type = types.ints.positive; default = 1; @@ -122,7 +138,7 @@ in sshKey = "/etc/nix/builder_ed25519"; system = "${stdenv.hostPlatform.uname.processor}-linux"; publicHostKey = "c3NoLWVkMjU1MTkgQUFBQUMzTnphQzFsWkRJMU5URTVBQUFBSUpCV2N4Yi9CbGFxdDFhdU90RStGOFFVV3JVb3RpQzVxQkorVXVFV2RWQ2Igcm9vdEBuaXhvcwo="; - inherit (cfg) maxJobs supportedFeatures; + inherit (cfg) maxJobs supportedFeatures systems; }]; nix.settings.builders-use-substitutes = true; From 6a3a683d4351e68d746a5aea6953395cedf921bf Mon Sep 17 00:00:00 2001 From: Ethan Turkeltaub Date: Wed, 22 Nov 2023 18:13:01 -0500 Subject: [PATCH 2/3] Use `nix.buildMachines.*.systems` instead of `nix.buildMachines.*.system` --- modules/nix/linux-builder.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/nix/linux-builder.nix b/modules/nix/linux-builder.nix index b5ba0191..d09a1cde 100644 --- a/modules/nix/linux-builder.nix +++ b/modules/nix/linux-builder.nix @@ -136,9 +136,9 @@ in hostName = "linux-builder"; sshUser = "builder"; sshKey = "/etc/nix/builder_ed25519"; - system = "${stdenv.hostPlatform.uname.processor}-linux"; + systems = [ "${stdenv.hostPlatform.uname.processor}-linux" ] ++ cfg.systems; publicHostKey = "c3NoLWVkMjU1MTkgQUFBQUMzTnphQzFsWkRJMU5URTVBQUFBSUpCV2N4Yi9CbGFxdDFhdU90RStGOFFVV3JVb3RpQzVxQkorVXVFV2RWQ2Igcm9vdEBuaXhvcwo="; - inherit (cfg) maxJobs supportedFeatures systems; + inherit (cfg) maxJobs supportedFeatures; }]; nix.settings.builders-use-substitutes = true; From 72dd60bfc98c128149d84213b17d1b8a68863055 Mon Sep 17 00:00:00 2001 From: Ethan Turkeltaub Date: Wed, 22 Nov 2023 20:40:03 -0500 Subject: [PATCH 3/3] Add default system to `systems` option --- modules/nix/linux-builder.nix | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/modules/nix/linux-builder.nix b/modules/nix/linux-builder.nix index d09a1cde..2fdcb4a4 100644 --- a/modules/nix/linux-builder.nix +++ b/modules/nix/linux-builder.nix @@ -59,14 +59,14 @@ in systems = mkOption { type = types.listOf types.str; - default = [ ]; + default = [ "${stdenv.hostPlatform.uname.processor}-linux" ]; example = literalExpression '' [ "x86_64-linux" "aarch64-linux" ] ''; - description = '' + description = lib.mdDoc '' This option specifies system types the build machine can execute derivations on. This sets the corresponding `nix.buildMachines.*.systems` option. @@ -136,9 +136,8 @@ in hostName = "linux-builder"; sshUser = "builder"; sshKey = "/etc/nix/builder_ed25519"; - systems = [ "${stdenv.hostPlatform.uname.processor}-linux" ] ++ cfg.systems; publicHostKey = "c3NoLWVkMjU1MTkgQUFBQUMzTnphQzFsWkRJMU5URTVBQUFBSUpCV2N4Yi9CbGFxdDFhdU90RStGOFFVV3JVb3RpQzVxQkorVXVFV2RWQ2Igcm9vdEBuaXhvcwo="; - inherit (cfg) maxJobs supportedFeatures; + inherit (cfg) maxJobs supportedFeatures systems; }]; nix.settings.builders-use-substitutes = true;