From 250885d0caed9ab910e801d7a3c21d6f83d4cdae Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Mon, 6 Jul 2020 01:48:19 -0400 Subject: [PATCH] nixos/nix-daemon.nix: assert distributedBuilds and buildMachines!=[] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without distributedBuilds, you can’t use buildMachines flag. Fixes #56593 --- nixos/modules/services/misc/nix-daemon.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nixos/modules/services/misc/nix-daemon.nix b/nixos/modules/services/misc/nix-daemon.nix index 0b3d7f3f03c3..8441b063e966 100644 --- a/nixos/modules/services/misc/nix-daemon.nix +++ b/nixos/modules/services/misc/nix-daemon.nix @@ -439,6 +439,13 @@ in config = { + assertions = [ + { + assertion = (!config.nix.distributedBuilds) && config.nix.buildMachines != []; + message = "You must set `nix.distributedBuilds = true` to use nix.buildMachines"; + } + ]; + nix.binaryCachePublicKeys = [ "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" ]; nix.binaryCaches = [ "https://cache.nixos.org/" ];