From f16bfa59e3fa1df211ac993c6cffbc762a4d4f04 Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Thu, 4 Dec 2025 23:23:57 -0600 Subject: [PATCH] home-environment: fix undefined access eval `uid` isn't guaranteed to be defined, have fallback logic in place to account for that. Even if we require it eventually, we can't show a proper assertion/warning without being able to eval. Signed-off-by: Austin Horstman --- nixos/common.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos/common.nix b/nixos/common.nix index 68eaa3aa..e9e27206 100644 --- a/nixos/common.nix +++ b/nixos/common.nix @@ -36,7 +36,7 @@ let modules = [ ( - { name, ... }: + { name, options, ... }: { imports = import ../modules/modules.nix { @@ -53,7 +53,7 @@ let home.username = config.users.users.${name}.name; home.homeDirectory = config.users.users.${name}.home; - home.uid = mkIf (config.users.users.${name}.uid != null) config.users.users.${name}.uid; + home.uid = mkIf (options.users.users.${name}.uid.isDefined or false) config.users.users.${name}.uid; # Forward `nix.enable` from the OS configuration. The # conditional is to check whether nix-darwin is new enough