nixos/modules/users/gb/default.nix
2024-02-26 12:17:27 +08:00

24 lines
749 B
Nix

inputs:
{
config =
let
inherit (inputs.lib) mkIf;
inherit (inputs.config.nixos) users;
in mkIf (builtins.elem "gb" users.users)
{
users.users.gb =
{
extraGroups = inputs.lib.intersectLists
[ "groupshare" "video" ]
(builtins.attrNames inputs.config.users.groups);
hashedPasswordFile = inputs.config.sops.secrets."users/gb".path;
openssh.authorizedKeys.keys = [ (builtins.readFile ./id_rsa.pub) ];
shell = inputs.pkgs.zsh;
autoSubUidGidRange = true;
};
home-manager.users.gb.imports = users.sharedModules;
sops.secrets."users/gb".neededForUsers = true;
nixos.services.groupshare.mountPoints = [ "/home/gb/groupshare" ];
};
}