From 30845beee0448bea77a7b8770ea9e6d17ca205d8 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Fri, 23 May 2025 13:12:56 +0200 Subject: [PATCH] nix.nixPath: Do not use environment.darwinConfig if set to null I've personally set it to `null` to make my `system.primaryUser = null;` configuration work on a machine with `stateVersion = 4;`. It may apply in other use cases as well. --- modules/nix/default.nix | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/modules/nix/default.nix b/modules/nix/default.nix index 540fbc5..8f8b6c4 100644 --- a/modules/nix/default.nix +++ b/modules/nix/default.nix @@ -443,11 +443,14 @@ in nixPath = mkOption { type = nixPathType; inherit (managedDefault "nix.nixPath" ( - lib.optionals cfg.channel.enable [ - # Include default path . - { darwin-config = "${config.environment.darwinConfig}"; } - "/nix/var/nix/profiles/per-user/root/channels" - ] + lib.optionals cfg.channel.enable ( + lib.optionals (config.environment.darwinConfig != null) [ + # Include default path . + { darwin-config = "${config.environment.darwinConfig}"; } + ] ++ [ + "/nix/var/nix/profiles/per-user/root/channels" + ] + ) )) default; defaultText = lib.literalExpression ''