feat(nixos): Setup users for servers

This commit is contained in:
punkfairie 2025-02-17 20:24:53 -08:00
parent bf7204f5b8
commit 38975ba714
Signed by: punkfairie
GPG key ID: B3C5488E9A1A7CA6

View file

@ -1,10 +1,17 @@
_: let
{
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 {
marleyos.my = {
inherit (my) name username fullName email;
@ -16,8 +23,14 @@ in {
users."${my.name}" = {
isNormalUser = true;
description = my.fullName;
extraGroups = ["networkmanager" "wheel"];
hashedPassword = "$y$j9T$ztWf9WeUCENC2T12qS4mi1$51ihV/5cQ8mdJJrNe7MMguk4hPB61S5xHawsfi.1hL3";
extraGroups =
["wheel"]
++ (lib.optional config.networking.networkmanager.enable "networkmanager")
++ (lib.optional config.virtualisation.docker.enable "docker");
hashedPassword =
if config.marleyos.isServer
then serverPass
else desktopPass;
};
};