From a908af9a955e64828f0b4f0c3b1c5770775c9794 Mon Sep 17 00:00:00 2001 From: Linnnus Date: Tue, 13 Feb 2024 17:24:57 +0100 Subject: tmp: Move ssh.nix to module --- hosts/ahmed/configuration.nix | 2 +- hosts/ahmed/ssh.nix | 19 ------------------- hosts/ahmed/ssh/default.nix | 19 +++++++++++++++++++ 3 files changed, 20 insertions(+), 20 deletions(-) delete mode 100644 hosts/ahmed/ssh.nix create mode 100644 hosts/ahmed/ssh/default.nix (limited to 'hosts/ahmed') diff --git a/hosts/ahmed/configuration.nix b/hosts/ahmed/configuration.nix index e0eb202..02ef997 100644 --- a/hosts/ahmed/configuration.nix +++ b/hosts/ahmed/configuration.nix @@ -8,7 +8,7 @@ }: { imports = [ ./hardware-configuration.nix - ./ssh.nix + ./ssh ]; # Create the main user. diff --git a/hosts/ahmed/ssh.nix b/hosts/ahmed/ssh.nix deleted file mode 100644 index 3c6b7ad..0000000 --- a/hosts/ahmed/ssh.nix +++ /dev/null @@ -1,19 +0,0 @@ -# This file configures openSSH on this host. -{ - lib, - metadata, - ... -}: { - # Who is allowed/expected to connect to this machine? - networking.firewall.allowedTCPPorts = [22]; - services.openssh = { - enable = true; - settings.PasswordAuthentication = false; - }; - - users.users = lib.genAttrs ["root" "linus"] (_: { - openssh.authorizedKeys.keys = [ - metadata.hosts.muhammed.sshPubKey - ]; - }); -} diff --git a/hosts/ahmed/ssh/default.nix b/hosts/ahmed/ssh/default.nix new file mode 100644 index 0000000..3c6b7ad --- /dev/null +++ b/hosts/ahmed/ssh/default.nix @@ -0,0 +1,19 @@ +# This file configures openSSH on this host. +{ + lib, + metadata, + ... +}: { + # Who is allowed/expected to connect to this machine? + networking.firewall.allowedTCPPorts = [22]; + services.openssh = { + enable = true; + settings.PasswordAuthentication = false; + }; + + users.users = lib.genAttrs ["root" "linus"] (_: { + openssh.authorizedKeys.keys = [ + metadata.hosts.muhammed.sshPubKey + ]; + }); +} -- cgit v1.2.3