diff options
Diffstat (limited to 'users')
-rw-r--r-- | users/gkleen/authorized-keys/gkleen-sif.pub | 1 | ||||
-rw-r--r-- | users/gkleen/default.nix | 47 | ||||
-rw-r--r-- | users/root.nix | 52 |
3 files changed, 100 insertions, 0 deletions
diff --git a/users/gkleen/authorized-keys/gkleen-sif.pub b/users/gkleen/authorized-keys/gkleen-sif.pub new file mode 100644 index 00000000..e9aaf215 --- /dev/null +++ b/users/gkleen/authorized-keys/gkleen-sif.pub | |||
@@ -0,0 +1 @@ | |||
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKrHPERae+OUTNOzNf9d2767ljFCm5hgmQw48Dj4RrlU gkleen@sif.midgard.yggdrasil | |||
diff --git a/users/gkleen/default.nix b/users/gkleen/default.nix new file mode 100644 index 00000000..d98ad82c --- /dev/null +++ b/users/gkleen/default.nix | |||
@@ -0,0 +1,47 @@ | |||
1 | { flake, userName, pkgs, customUtils, lib, ... }: | ||
2 | { | ||
3 | imports = with flake.nixosModules.userProfiles.${userName}; [ | ||
4 | zsh tmux utils direnv | ||
5 | ]; | ||
6 | |||
7 | users.users.${userName} = { | ||
8 | description = "Gregor Kleen"; | ||
9 | extraGroups = [ "wheel" "networkmanager" "lp" "dialout" "audio" "video" "xmpp" "mail" "ssh" "vboxusers" "libvirtd" "wireshark" "games"]; | ||
10 | group = "users"; | ||
11 | uid = 1000; | ||
12 | createHome = true; | ||
13 | home = "/home/${userName}"; | ||
14 | shell = "${pkgs.zsh}/bin/zsh"; | ||
15 | isNormalUser = true; | ||
16 | openssh.authorizedKeys.keyFiles = lib.attrValues (customUtils.recImport rec { dir = ./authorized-keys; _import = name: _base: dir + "/${name}"; }); | ||
17 | hashedPassword = "$6$rounds=500000$dOMgCU7DAk$yQFYGOURTEt12387LIYBnFKSWmtwXMUk1LJWnV0m7OFt.y2TnxQn2abdGA5dhwG9EmMB5wZGXf4J5F71c746C/"; | ||
18 | }; | ||
19 | |||
20 | home-manager.users.${userName} = { | ||
21 | programs = { | ||
22 | git = { | ||
23 | enable = true; | ||
24 | userEmail = "gkleen@yggdrasil.li"; | ||
25 | userName = "Gregor Kleen"; | ||
26 | delta.enable = true; | ||
27 | extraConfig = { | ||
28 | pull.rebase = false; | ||
29 | }; | ||
30 | }; | ||
31 | |||
32 | ssh = { | ||
33 | enable = true; | ||
34 | controlMaster = "auto"; | ||
35 | controlPersist = "30m"; | ||
36 | serverAliveInterval = 6; | ||
37 | hashKnownHosts = true; | ||
38 | extraConfig = '' | ||
39 | IdentitiesOnly true | ||
40 | ServerAliveCountMax 10 | ||
41 | ''; | ||
42 | }; | ||
43 | |||
44 | gpg.enable = true; | ||
45 | }; | ||
46 | }; | ||
47 | } | ||
diff --git a/users/root.nix b/users/root.nix new file mode 100644 index 00000000..be331141 --- /dev/null +++ b/users/root.nix | |||
@@ -0,0 +1,52 @@ | |||
1 | { flake, lib, config, hostName, userName, pkgs, ... }: | ||
2 | let | ||
3 | haveGKleen = flake.nixosModules.accounts ? "gkleen@${hostName}"; | ||
4 | in { | ||
5 | imports = with flake.nixosModules.userProfiles.${userName}; [ | ||
6 | zsh tmux direnv utils | ||
7 | ]; | ||
8 | |||
9 | users.users.${userName} = lib.mkIf haveGKleen { | ||
10 | inherit (config.users.users."gkleen") hashedPassword shell; | ||
11 | openssh.authorizedKeys.keyFiles = config.users.users."gkleen".openssh.authorizedKeys.keyFiles; | ||
12 | }; | ||
13 | |||
14 | home-manager.users.${userName} = { | ||
15 | programs = { | ||
16 | git = { | ||
17 | enable = true; | ||
18 | userEmail = "gkleen@yggdrasil.li"; | ||
19 | userName = "Gregor Kleen"; | ||
20 | delta.enable = true; | ||
21 | extraConfig = { | ||
22 | pull.rebase = false; | ||
23 | }; | ||
24 | }; | ||
25 | |||
26 | ssh = { | ||
27 | enable = true; | ||
28 | controlMaster = "auto"; | ||
29 | controlPersist = "30m"; | ||
30 | serverAliveInterval = 6; | ||
31 | hashKnownHosts = true; | ||
32 | extraConfig = '' | ||
33 | IdentitiesOnly true | ||
34 | ServerAliveCountMax 10 | ||
35 | ''; | ||
36 | }; | ||
37 | |||
38 | gpg.enable = true; | ||
39 | }; | ||
40 | |||
41 | services = { | ||
42 | gpg-agent = { | ||
43 | enable = true; | ||
44 | enableSshSupport = true; | ||
45 | extraConfig = '' | ||
46 | pinentry-program ${pkgs.pinentry-curses}/bin/pinentry | ||
47 | grab | ||
48 | ''; | ||
49 | }; | ||
50 | }; | ||
51 | }; | ||
52 | } | ||