From a2362a64964c406ba3b289a474fbde573f4b7fc9 Mon Sep 17 00:00:00 2001 From: Anton Tetov Date: Wed, 22 Jan 2025 17:40:23 +0100 Subject: [PATCH] nh: check osConfig for null before accessing --- modules/programs/nh.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/programs/nh.nix b/modules/programs/nh.nix index a5e8dcfaf..cf6c06e54 100644 --- a/modules/programs/nh.nix +++ b/modules/programs/nh.nix @@ -52,8 +52,8 @@ in { }; config = { - warnings = lib.optionals (!(cfg.clean.enable -> !osConfig.nix.gc.automatic)) - [ + warnings = lib.optionals + (osConfig != null && !(cfg.clean.enable -> !osConfig.nix.gc.automatic)) [ "programs.nh.clean.enable and nix.gc.automatic (system-wide in configuration.nix) are both enabled. Please use one or the other to avoid conflict." ];