Major revamp.
This commit is contained in:
42
nixos/users.nix
Normal file
42
nixos/users.nix
Normal file
@@ -0,0 +1,42 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
# Define a user account. Don't forget to set a password with ‘passwd’.
|
||||
users.extraUsers.itpartner = {
|
||||
description = "Serit IT Partner Tromsø";
|
||||
home = "/home/itpartner";
|
||||
extraGroups = [
|
||||
"users"
|
||||
"wheel"
|
||||
"root"
|
||||
"adm"
|
||||
"docker"
|
||||
];
|
||||
uid = 1000;
|
||||
isNormalUser = true;
|
||||
createHome = true;
|
||||
useDefaultShell = false;
|
||||
shell = pkgs.fish;
|
||||
openssh.authorizedKeys.keys = [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKiAS30ZO+wgfAqDE9Y7VhRunn2QszPHA5voUwo+fGOf jonas"
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDCGrS7PzjPhVnHftYRw7iCD5K1UXnxtFMS0zVLcGH3u daniel.stien@itpartner.no"
|
||||
];
|
||||
};
|
||||
|
||||
users.extraUsers.root.openssh.authorizedKeys.keys = [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKiAS30ZO+wgfAqDE9Y7VhRunn2QszPHA5voUwo+fGOf jonas"
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDCGrS7PzjPhVnHftYRw7iCD5K1UXnxtFMS0zVLcGH3u daniel.stien@itpartner.no"
|
||||
];
|
||||
|
||||
security.sudo.wheelNeedsPassword = false;
|
||||
security.sudo.extraConfig =
|
||||
''
|
||||
Defaults:root,%wheel env_keep+=LOCALE_ARCHIVE
|
||||
Defaults:root,%wheel env_keep+=NIX_PATH
|
||||
Defaults:root,%wheel env_keep+=TERMINFO_DIRS
|
||||
Defaults env_keep+=SSH_AUTH_SOCK
|
||||
Defaults lecture=never
|
||||
Defaults shell_noargs
|
||||
root ALL=(ALL) SETENV: ALL
|
||||
%wheel ALL=(ALL) NOPASSWD: ALL, SETENV: ALL
|
||||
'';
|
||||
}
|
||||
Reference in New Issue
Block a user