modified user to be modular, separated machine specific configs

This commit is contained in:
2024-11-05 19:46:59 -05:00
parent e19f24b5dd
commit 55d5cea59f
5 changed files with 30 additions and 22 deletions

37
modules/common/users.nix Normal file
View File

@ -0,0 +1,37 @@
{
lib,
pkgs,
userName,
hostname,
...
} @ args: {
# Set up networking configuration
networking.hostName = hostname;
# networking.computerName = hostname;
# networking.firewall.enable = true; # VERY important, do not touch
# networking.firewall.allowedTCPPorts = [];
# networking.firewall.allowedUDPPorts = [];
# networking.networkmanager.enable = pkgs.stdenv.isLinux; # Linux tool for managing network connections
# system.defaults.smb.NetBIOSName = hostname;
# Set up user accounts
# Don't forget to set a password with passwd!
users.users."${userName}" = lib.mkMerge [
{
home =
if pkgs.stdenv.isDarwin
then "/Users/${userName}"
else "/home/${userName}";
description = userName;
}
(lib.mkIf (pkgs.stdenv.isLinux) {
group = "${userName}";
isNormalUser = true;
})
];
users.groups.wyatt = {};
nix.settings.trusted-users = [userName];
}