marleyos/modules/nixos/users.nix
2025-05-26 11:20:05 -07:00

51 lines
1.2 KiB
Nix

{
inputs,
lib,
config,
...
}: let
my = {
name = "marley";
username = "punkfairie";
fullName = "Marley Rae";
email = "marley@punkfairie.net";
};
desktopPass = "$y$j9T$ztWf9WeUCENC2T12qS4mi1$51ihV/5cQ8mdJJrNe7MMguk4hPB61S5xHawsfi.1hL3";
serverPass = "$y$j9T$8hA7OWZsdQMHqYIy8LkYQ1$hFeP2ak3QA4FtoIYIwqPg10//ZOSZrAw1PzJj0PuGSA";
in {
imports = [inputs.home-manager.nixosModules.home-manager];
config = {
marleycfg.my = {
inherit (my) name username fullName email;
};
users = {
mutableUsers = false;
groups = {
"compat" = {
gid = 1000;
};
};
users."${my.name}" = {
isNormalUser = true;
description = my.fullName;
extraGroups =
["wheel" "compat"]
++ (lib.optional config.networking.networkmanager.enable "networkmanager")
++ (lib.optional config.virtualisation.docker.enable "docker");
hashedPassword =
if config.marleycfg.profiles.server
then serverPass
else desktopPass;
};
};
home-manager.users."${my.name}" = {
home.homeDirectory = "/home/${my.name}";
};
};
}