Files
nix-docker/users.nix
2024-12-18 01:05:41 +00:00

35 lines
828 B
Nix

{ config, ... }:
let
userName = "john";
userOptions = {
home.stateVersion = config.system.stateVersion;
imports = [ ./git.nix ];
};
# stateVersion = config.system.stateVersion;
in
{
# Uses rust-based sudo
security.sudo-rs = {
enable = true;
execWheelOnly = false;
wheelNeedsPassword = false; # allows sudo without password for those in the wheel group
};
users.users.${userName} = {
isNormalUser = true;
extraGroups = [
"wheel" # needed for sudo without password
"docker" # needed for docker without sudo
];
openssh.authorizedKeys.keyFiles = [
"/root/.ssh/authorized_keys" # should already have your public SSH key inside
];
};
home-manager = {
useGlobalPkgs = true;
users.root = userOptions;
users.${userName} = userOptions;
};
}