nix-config-v2/modules/host-users.nix

32 lines
857 B
Nix
Raw Normal View History

2024-07-29 23:09:42 -05:00
{
2024-09-07 00:52:43 -05:00
pkgs,
userName,
2024-07-29 23:09:42 -05:00
hostname,
...
} @ args: {
# Set up networking configuration
2024-07-29 23:09:42 -05:00
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
2024-07-29 23:09:42 -05:00
system.defaults.smb.NetBIOSName = hostname;
# Set up user accounts
# Don't forget to set a password with passwd!
2024-09-07 00:52:43 -05:00
users.users."${userName}" = {
home =
if pkgs.stdenv.isDarwin
then "/Users/${userName}"
else "/home/${userName}";
description = userName;
extraGroups =
if pkgs.stdenv.isLinux
then ["wheel" "video"]
else [];
2024-07-29 23:09:42 -05:00
};
2024-09-07 00:52:43 -05:00
nix.settings.trusted-users = [userName];
2024-07-29 23:09:42 -05:00
}