core/users: conditionally enable user options

We don't want to create extra groups on the server user, and we don't
wanna setup hjem for it either.
This commit is contained in:
Anthony Rodriguez 2025-02-06 15:22:21 +01:00
parent 559f99cfde
commit 35f03cf90f
Signed by: nezia
SSH key fingerprint: SHA256:Ihfpl0rUpqDevYqnzSR34OYfVLbDNkBiUjs3CpX4ykA

View file

@ -3,13 +3,15 @@
config, config,
... ...
}: let }: let
inherit (lib) mkIf;
inherit (config.local.systemVars) username; inherit (config.local.systemVars) username;
inherit (config.local.homeVars) fullName;
inherit (config.local.profiles) desktop;
in { in {
config = lib.mkIf (!config.local.profiles.server.enable) { users.users.${username} = {
users.users.${config.local.systemVars.username} = {
isNormalUser = true; isNormalUser = true;
description = config.local.homeVars.fullName or "User"; description = fullName;
extraGroups = [ extraGroups = mkIf desktop.enable [
"networkmanager" "networkmanager"
"audio" "audio"
"video" "video"
@ -18,7 +20,7 @@ in {
]; ];
}; };
hjem = { hjem = mkIf desktop.enable {
clobberByDefault = true; clobberByDefault = true;
users.${username} = { users.${username} = {
enable = true; enable = true;
@ -29,5 +31,4 @@ in {
}; };
}; };
}; };
};
} }