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with "users".options.customUsers = {enable = lib.mkEnableOption "users";passwordFile = lib.mkOption {type = types.path;example = "/run/agenix/password";description = "Path to the password secret file";};primaryUserExtraGroups = lib.mkOption {type = with types; listOf str;default = [ "wheel" ];example = [ "wheel" "networkmanager" "docker" ];description = "Extra groups for jam";};buildUser = lib.mkEnableOption "build user (for CI/CD)";forgejoUser = lib.mkEnableOption "forgejo user for forgejo host";};config = mkIf config.customUsers.enable {age.secrets.password.rekeyFile = config.customUsers.passwordFile;users.users = {root = {shell = pkgs.nushell;hashedPasswordFile = config.age.secrets.password.path;openssh.authorizedKeys.keys = keys.admins;};jam = {description = "Jam";isNormalUser = true;shell = pkgs.nushell;hashedPasswordFile = config.age.secrets.password.path;openssh.authorizedKeys.keys = keys.admins;extraGroups = config.customUsers.primaryUserExtraGroups;};build = mkIf config.customUsers.buildUser {description = "Build";isNormalUser = true;createHome = false;openssh.authorizedKeys.keys = keys.all;extraGroups = [ "build" ];};forgejo = mkIf config.customUsers.forgejoUser {description = "Forgejo";createHome = false;openssh.authorizedKeys.keys = keys.admins;};};home-manager.users = {root = {};jam = {};};};}
age.secrets.password.rekeyFile = self + /secrets/yuzu-password.age;users.users = {root = {shell = pkgs.nushell;hashedPasswordFile = config.age.secrets.password.path;openssh.authorizedKeys.keys = keys.admins;};jam = {description = "Jam";isNormalUser = true;shell = pkgs.nushell;hashedPasswordFile = config.age.secrets.password.path;openssh.authorizedKeys.keys = keys.admins;extraGroups = [ "wheel" "networkmanager" "docker" ];};};home-manager.users = {root = {};jam = {};
customUsers = enabled {passwordFile = self + /secrets/yuzu-password.age;primaryUserExtraGroups = [ "wheel" "networkmanager" "docker" ];
};age.secrets.password.rekeyFile = self + /secrets/plum-password.age;users.users = {root = {shell = pkgs.nushell;openssh.authorizedKeys.keys = keys.admins;hashedPasswordFile = config.age.secrets.password.path;};jam = {description = "Jam";isNormalUser = true;shell = pkgs.nushell;hashedPasswordFile = config.age.secrets.password.path;openssh.authorizedKeys.keys = keys.admins;extraGroups = [ "wheel" ];};build = {description = "Build";isNormalUser = true;createHome = false;openssh.authorizedKeys.keys = keys.all;extraGroups = [ "build" ];};forgejo = {description = "Forgejo";createHome = false;openssh.authorizedKeys.keys = keys.admins;};
age.secrets.password.rekeyFile = self + /secrets/pear-password.age;users.users = {root = {shell = pkgs.nushell;hashedPasswordFile = config.age.secrets.password.path;openssh.authorizedKeys.keys = keys.admins;};jam = {description = "Jam";isNormalUser = true;shell = pkgs.nushell;hashedPasswordFile = config.age.secrets.password.path;openssh.authorizedKeys.keys = keys.admins;extraGroups = [ "wheel" "docker" "dialout" ]; # Dialout for serial, Docker for docker-desktop.};};home-manager.users = {root = {};jam = {};
customUsers = enabled {passwordFile = self + /secrets/pear-password.age;primaryUserExtraGroups = [ "wheel" "dialout" "docker" ];
};age.secrets.password.rekeyFile = self + /secrets/kiwi-password.age;users.users = {root = {shell = pkgs.nushell;hashedPasswordFile = config.age.secrets.password.path;openssh.authorizedKeys.keys = keys.admins;};jam = {description = "Jam";isNormalUser = true;shell = pkgs.nushell;hashedPasswordFile = config.age.secrets.password.path;openssh.authorizedKeys.keys = keys.admins;extraGroups = [ "wheel" ];};build = {description = "Build";isNormalUser = true;createHome = false;openssh.authorizedKeys.keys = keys.all;extraGroups = [ "build" ];};
age.secrets.password.rekeyFile = self + /secrets/date-password.age;users.users = {root = {shell = pkgs.nushell;hashedPasswordFile = config.age.secrets.password.path;openssh.authorizedKeys.keys = keys.admins;};jam = {description = "Jam";isNormalUser = true;shell = pkgs.nushell;hashedPasswordFile = config.age.secrets.password.path;openssh.authorizedKeys.keys = keys.admins;extraGroups = [ "wheel" "networkmanager" "docker" ];};};home-manager.users = {root = {};jam = {};
customUsers = enabled {passwordFile = self + /secrets/date-password.age;primaryUserExtraGroups = [ "wheel" "networkmanager" "docker" ];