nixos/system/users.nix
2024-06-07 18:14:25 +02:00

47 lines
1.1 KiB
Nix

{
conf,
config,
...
} @ inputs: {
users.mutableUsers = false;
users.users = {
${conf.user} = {
isNormalUser = true;
uid = conf.uid;
extraGroups = ["wheel" "networkmanager"];
hashedPasswordFile = config.sops.secrets."user/password".path;
};
};
home-manager = {
extraSpecialArgs = inputs // {system-config = config;};
useGlobalPkgs = true;
useUserPackages = true;
};
home-manager.users = let
hm = {user = [];}; # import ../home;
in {
${conf.user} = {
imports = hm.user;
# home.username = conf.user;
# home.stateVersion = "24.11";
};
};
sops.secrets."user/password" = {
sopsFile = ../hosts/${conf.hostname}/secrets/default.yaml;
neededForUsers = true;
};
sops.secrets."user/ssh/private" = {
sopsFile = ../hosts/${conf.hostname}/secrets/default.yaml;
path = "/home/lilith/.ssh/id_ed25519";
owner = "lilith";
};
sops.secrets."user/ssh/public" = {
sopsFile = ../hosts/${conf.hostname}/secrets/default.yaml;
path = "/home/lilith/.ssh/id_ed25519.pub";
owner = "lilith";
};
}