Browse Source

factor out into lib/admins.nix

container/radius
Astro 4 months ago
parent
commit
9bd5208c2f

+ 1
- 0
hosts/glotzbert/configuration.nix View File

@@ -16,6 +16,7 @@ in
16 16
   imports =
17 17
     [ # Include the results of the hardware scan.
18 18
       ./hardware-configuration.nix
19
+      ../../lib/admins.nix
19 20
     ];
20 21
 
21 22
   # Use the systemd-boot EFI boot loader.

+ 1
- 0
hosts/pulsebert/configuration.nix View File

@@ -11,6 +11,7 @@ in {
11 11
   imports =
12 12
     [ # Include the results of the hardware scan.
13 13
       ./hardware-configuration.nix
14
+      ../../lib/admins.nix
14 15
     ];
15 16
 
16 17
   # Use the systemd-boot EFI boot loader.

+ 1
- 0
hosts/storage-ng/dhcp/configuration.nix View File

@@ -4,6 +4,7 @@
4 4
   imports =
5 5
     [ ../../../lib/lxc-container.nix
6 6
       ../../../lib/shared.nix
7
+      ../../../lib/admins.nix
7 8
     ];
8 9
 
9 10
   networking.hostName = "dhcp";

+ 1
- 0
hosts/storage-ng/grafana/configuration.nix View File

@@ -4,6 +4,7 @@
4 4
   imports =
5 5
     [ ../../../lib/lxc-container.nix
6 6
       ../../../lib/shared.nix
7
+      ../../../lib/admins.nix
7 8
     ];
8 9
 
9 10
   networking.hostName = "grafana";

+ 1
- 0
hosts/storage-ng/mucbot/configuration.nix View File

@@ -7,6 +7,7 @@ in
7 7
   imports =
8 8
     [ ../../../lib/lxc-container.nix
9 9
       ../../../lib/shared.nix
10
+      ../../../lib/admins.nix
10 11
       "${tiggerGit}/module.nix"
11 12
     ];
12 13
 

+ 7
- 0
lib/admins.nix View File

@@ -0,0 +1,7 @@
1
+{ config, ... }:
2
+{
3
+  users.users.root.openssh.authorizedKeys.keys =
4
+    if config.services.openssh.enable
5
+    then (import ../secrets/lib/authorized_keys).admins
6
+    else [];
7
+}

+ 0
- 1
lib/lxc-container.nix View File

@@ -28,5 +28,4 @@
28 28
 
29 29
   # Required for remote deployment
30 30
   services.openssh.enable = true;
31
-  users.users.root.openssh.authorizedKeys.keys = (import ../secrets/lib/authorized_keys).admins;
32 31
 }

Loading…
Cancel
Save