flocon/modules/core/users.nix
Anthony Rodriguez f6fedf748f
treewide: add environment module from hjem PR
This commit adds the module I made for hjem (https://github.com/feel-co/hjem/pull/16). Needs to be removed after it gets merged.
2025-02-13 16:42:58 +01:00

40 lines
884 B
Nix

{
inputs,
lib,
config,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.lists) singleton;
inherit (lib.filesystem) listFilesRecursive;
inherit (config.local.systemVars) username;
inherit (config.local.homeVars) fullName;
inherit (config.local.profiles) desktop;
in {
imports = [inputs.hjem.nixosModules.default];
users.users.${username} = {
isNormalUser = true;
description = fullName;
extraGroups = mkIf desktop.enable [
"networkmanager"
"audio"
"video"
"wheel"
"plugdev"
];
};
hjem = mkIf desktop.enable {
clobberByDefault = true;
users.${username} = {
enable = true;
directory = "/home/${username}";
user = "${username}";
environment.forceOverride = true;
};
extraModules = singleton {
imports = listFilesRecursive ../../shared/modules/hjem;
};
};
}