factor out into lib/admins.nix

This commit is contained in:
Astro 2019-04-07 21:23:31 +02:00
parent 098be6aba0
commit 9bd5208c2f
7 changed files with 12 additions and 1 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

7
lib/admins.nix Normal file
View File

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

View File

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