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:
parent
559f99cfde
commit
35f03cf90f
1 changed files with 22 additions and 21 deletions
|
@ -3,13 +3,15 @@
|
|||
config,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
inherit (config.local.systemVars) username;
|
||||
inherit (config.local.homeVars) fullName;
|
||||
inherit (config.local.profiles) desktop;
|
||||
in {
|
||||
config = lib.mkIf (!config.local.profiles.server.enable) {
|
||||
users.users.${config.local.systemVars.username} = {
|
||||
users.users.${username} = {
|
||||
isNormalUser = true;
|
||||
description = config.local.homeVars.fullName or "User";
|
||||
extraGroups = [
|
||||
description = fullName;
|
||||
extraGroups = mkIf desktop.enable [
|
||||
"networkmanager"
|
||||
"audio"
|
||||
"video"
|
||||
|
@ -18,7 +20,7 @@ in {
|
|||
];
|
||||
};
|
||||
|
||||
hjem = {
|
||||
hjem = mkIf desktop.enable {
|
||||
clobberByDefault = true;
|
||||
users.${username} = {
|
||||
enable = true;
|
||||
|
@ -29,5 +31,4 @@ in {
|
|||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue