1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-12-08 18:11:05 +01:00

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 <khaneliman12@gmail.com>
This commit is contained in:
Austin Horstman 2025-12-04 23:23:57 -06:00
parent 35545f71dd
commit f16bfa59e3

View file

@ -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