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
ed3dde6c28
commit
7dcc38f6a2
1 changed files with 22 additions and 21 deletions
|
@ -3,30 +3,31 @@
|
||||||
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 = fullName;
|
||||||
description = config.local.homeVars.fullName or "User";
|
extraGroups = mkIf desktop.enable [
|
||||||
extraGroups = [
|
"networkmanager"
|
||||||
"networkmanager"
|
"audio"
|
||||||
"audio"
|
"video"
|
||||||
"video"
|
"wheel"
|
||||||
"wheel"
|
"plugdev"
|
||||||
"plugdev"
|
];
|
||||||
];
|
};
|
||||||
};
|
|
||||||
|
|
||||||
hjem = {
|
hjem = mkIf desktop.enable {
|
||||||
clobberByDefault = true;
|
clobberByDefault = true;
|
||||||
users.${username} = {
|
users.${username} = {
|
||||||
enable = true;
|
enable = true;
|
||||||
directory = "/home/${username}";
|
directory = "/home/${username}";
|
||||||
user = "${username}";
|
user = "${username}";
|
||||||
environment = {
|
environment = {
|
||||||
forceOverride = true;
|
forceOverride = true;
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue