mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-24 13:05:08 +00:00
nixos/nix-daemon: assert system or systems for buildMachines.
Commit 5395397f
removed the assertions from the buildMachines to
ensure that either system or systems is set for each buildmachine.
This patch re-implements those assertions.
The symptom is that if both system and systems are omitted, then the
/etc/machines file has the wrong number of columns and any attempt to
run a `nix` operation that has to perform a build will fail with a
`strtoull` exception.
This commit is contained in:
parent
27693c7205
commit
58921a4904
@ -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 <varname>system</varname> or
|
||||
<varname>systems</varname>) 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 ];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user