summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-08-02 22:40:47 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-08-02 23:13:36 +0200
commit4c978e0ccbed6e6a7fdaa2cde21f3951aa0a8ab8 (patch)
treecfb191781ebac23e531d12ad5f3fc9e0f3e8305f
parentfix(nixos/git-server): Add the required configuration to support http-clone (diff)
downloadnixos-server-4c978e0ccbed6e6a7fdaa2cde21f3951aa0a8ab8.tar.gz
nixos-server-4c978e0ccbed6e6a7fdaa2cde21f3951aa0a8ab8.zip
refactor(nixos/openssh): Migrate from `system/services`
-rw-r--r--modules/nixos/vhack/default.nix1
-rw-r--r--modules/nixos/vhack/openssh/default.nix31
-rw-r--r--system/services/default.nix1
-rw-r--r--system/services/openssh/default.nix17
4 files changed, 32 insertions, 18 deletions
diff --git a/modules/nixos/vhack/default.nix b/modules/nixos/vhack/default.nix
index cb0131f..bed22af 100644
--- a/modules/nixos/vhack/default.nix
+++ b/modules/nixos/vhack/default.nix
@@ -4,6 +4,7 @@
     ./git-server
     ./nginx
     ./nix-sync
+    ./openssh
     ./peertube
   ];
 }
diff --git a/modules/nixos/vhack/openssh/default.nix b/modules/nixos/vhack/openssh/default.nix
new file mode 100644
index 0000000..30d16a6
--- /dev/null
+++ b/modules/nixos/vhack/openssh/default.nix
@@ -0,0 +1,31 @@
+{
+  config,
+  lib,
+  ...
+}: let
+  cfg = config.vhack.openssh;
+in {
+  options.vhack.openssh = {
+    enable = lib.mkEnableOption ''
+      a sane openssh implementation.
+    '';
+  };
+
+  config = lib.mkIf cfg.enable {
+    services.openssh = {
+      enable = true;
+      settings.PasswordAuthentication = false;
+      hostKeys = [
+        {
+          # See the explanation for this in /system/impermanence/mods/openssh.nix
+          # path = "/var/lib/sshd/ssh_host_ed25519_key";
+
+          # FIXME: Remove this workaround
+          path = "/srv/var/lib/sshd/ssh_host_ed25519_key";
+          rounds = 1000;
+          type = "ed25519";
+        }
+      ];
+    };
+  };
+}
diff --git a/system/services/default.nix b/system/services/default.nix
index 3155272..52ad177 100644
--- a/system/services/default.nix
+++ b/system/services/default.nix
@@ -11,7 +11,6 @@
     ./miniflux
     ./murmur
     ./nix
-    ./openssh
     ./restic
     ./rust-motd
     ./taskserver
diff --git a/system/services/openssh/default.nix b/system/services/openssh/default.nix
deleted file mode 100644
index 46b7ffd..0000000
--- a/system/services/openssh/default.nix
+++ /dev/null
@@ -1,17 +0,0 @@
-{...}: {
-  services.openssh = {
-    enable = true;
-    settings.PasswordAuthentication = false;
-    hostKeys = [
-      {
-        # See the explanation for this in /system/impermanence/mods/openssh.nix
-        # path = "/var/lib/sshd/ssh_host_ed25519_key";
-
-        # FIXME: Remove this workaround
-        path = "/srv/var/lib/sshd/ssh_host_ed25519_key";
-        rounds = 1000;
-        type = "ed25519";
-      }
-    ];
-  };
-}