diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2021-01-03 00:55:29 +0100 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2021-01-03 16:21:34 +0100 |
commit | 4a3d2a8ddaf4e546df360656bc54b2947bdb890b (patch) | |
tree | f571511e0b74fbd7e78f7e10966a8d6d5d400241 /users | |
parent | 3b5ab82fa714a0d483a7b90d60f9f7c857646e33 (diff) | |
download | nixos-4a3d2a8ddaf4e546df360656bc54b2947bdb890b.tar nixos-4a3d2a8ddaf4e546df360656bc54b2947bdb890b.tar.gz nixos-4a3d2a8ddaf4e546df360656bc54b2947bdb890b.tar.bz2 nixos-4a3d2a8ddaf4e546df360656bc54b2947bdb890b.tar.xz nixos-4a3d2a8ddaf4e546df360656bc54b2947bdb890b.zip |
gkleen@sif: import
Diffstat (limited to 'users')
-rw-r--r-- | users/gkleen/default.nix | 34 | ||||
-rw-r--r-- | users/root.nix | 29 |
2 files changed, 59 insertions, 4 deletions
diff --git a/users/gkleen/default.nix b/users/gkleen/default.nix index f74701a5..26f7a1d4 100644 --- a/users/gkleen/default.nix +++ b/users/gkleen/default.nix | |||
@@ -1,5 +1,9 @@ | |||
1 | { userName, pkgs, customUtils, lib, ... }: | 1 | { flake, userName, pkgs, customUtils, lib, ... }: |
2 | { | 2 | { |
3 | imports = with flake.nixosModules.userProfiles.${userName}; [ | ||
4 | zsh tmux utils | ||
5 | ]; | ||
6 | |||
3 | users.users.${userName} = { | 7 | users.users.${userName} = { |
4 | description = "Gregor Kleen"; | 8 | description = "Gregor Kleen"; |
5 | extraGroups = [ "wheel" "networkmanager" "lp" "dialout" "audio" "video" "xmpp" "mail" "ssh" "vboxusers" "libvirtd" "wireshark" "games"]; | 9 | extraGroups = [ "wheel" "networkmanager" "lp" "dialout" "audio" "video" "xmpp" "mail" "ssh" "vboxusers" "libvirtd" "wireshark" "games"]; |
@@ -12,4 +16,32 @@ | |||
12 | openssh.authorizedKeys.keyFiles = lib.attrValues (customUtils.recImport rec { dir = ./authorized-keys; _import = name: _base: dir + "/${name}"; }); | 16 | openssh.authorizedKeys.keyFiles = lib.attrValues (customUtils.recImport rec { dir = ./authorized-keys; _import = name: _base: dir + "/${name}"; }); |
13 | hashedPassword = "$6$rounds=500000$dOMgCU7DAk$yQFYGOURTEt12387LIYBnFKSWmtwXMUk1LJWnV0m7OFt.y2TnxQn2abdGA5dhwG9EmMB5wZGXf4J5F71c746C/"; | 17 | hashedPassword = "$6$rounds=500000$dOMgCU7DAk$yQFYGOURTEt12387LIYBnFKSWmtwXMUk1LJWnV0m7OFt.y2TnxQn2abdGA5dhwG9EmMB5wZGXf4J5F71c746C/"; |
14 | }; | 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 | }; | ||
15 | } | 47 | } |
diff --git a/users/root.nix b/users/root.nix index 95fe37c4..c6e7d712 100644 --- a/users/root.nix +++ b/users/root.nix | |||
@@ -1,7 +1,30 @@ | |||
1 | { flake, lib, config, hostName, ... }: | 1 | { flake, lib, config, hostName, userName, pkgs, ... }: |
2 | { | 2 | let |
3 | users.users.root = lib.mkIf (flake.nixosModules.accounts ? "gkleen@${hostName}") { | 3 | haveGKleen = flake.nixosModules.accounts ? "gkleen@${hostName}"; |
4 | in { | ||
5 | imports = with flake.nixosModules.userProfiles.${userName}; [ | ||
6 | zsh tmux utils | ||
7 | ]; | ||
8 | |||
9 | users.users.${userName} = lib.mkIf haveGKleen { | ||
4 | inherit (config.users.users."gkleen") hashedPassword shell; | 10 | inherit (config.users.users."gkleen") hashedPassword shell; |
5 | openssh.authorizedKeys.keyFiles = config.users.users."gkleen".openssh.authorizedKeys.keyFiles; | 11 | openssh.authorizedKeys.keyFiles = config.users.users."gkleen".openssh.authorizedKeys.keyFiles; |
6 | }; | 12 | }; |
13 | |||
14 | home-manager.users.${userName} = { | ||
15 | programs = lib.mkIf haveGKleen { | ||
16 | inherit (config.home-manager.users.gkleen.programs) git ssh gpg; | ||
17 | }; | ||
18 | |||
19 | services = { | ||
20 | gpg-agent = { | ||
21 | enable = true; | ||
22 | enableSshSupport = true; | ||
23 | extraConfig = '' | ||
24 | pinentry-program ${pkgs.pinentry-curses}/bin/pinentry | ||
25 | grab | ||
26 | ''; | ||
27 | }; | ||
28 | }; | ||
29 | }; | ||
7 | } | 30 | } |