diff --git a/nixos/modules/services/misc/nix-daemon.nix b/nixos/modules/services/misc/nix-daemon.nix index 64bdbf159d51..19cbf8136a14 100644 --- a/nixos/modules/services/misc/nix-daemon.nix +++ b/nixos/modules/services/misc/nix-daemon.nix @@ -533,6 +533,22 @@ in + "\n" ) cfg.buildMachines; }; + assertions = + let badMachine = m: m.system == null && m.systems == []; + in [ + { + assertion = !(builtins.any badMachine cfg.buildMachines); + message = '' + At least one system type (via system or + systems) must be set for every build machine. + Invalid machine specifications: + '' + " " + + (builtins.concatStringsSep "\n " + (builtins.map (m: m.hostName) + (builtins.filter (badMachine) cfg.buildMachines))); + } + ]; + systemd.packages = [ nix ];