about summary refs log tree commit diff
path: root/modules/endlessh.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/endlessh.nix')
-rw-r--r--modules/endlessh.nix30
1 files changed, 30 insertions, 0 deletions
diff --git a/modules/endlessh.nix b/modules/endlessh.nix
new file mode 100644
index 0000000..f1bf0bc
--- /dev/null
+++ b/modules/endlessh.nix
@@ -0,0 +1,30 @@
+{ config, lib, ... }:
+with lib;
+let
+  cfg = config.nixfiles.modules.endlessh;
+in
+{
+  options.nixfiles.modules.endlessh.enable = mkEnableOption "endlessh";
+
+  config =
+    let
+      port = 22;
+    in
+    mkIf cfg.enable {
+      ark.directories = [
+        "/var/lib/gotify-server"
+        "/var/lib/private/gotify-server"
+      ];
+
+      services.endlessh = {
+        enable = true;
+        inherit port;
+        extraOptions = [
+          "-v"
+          "-4"
+        ];
+      };
+
+      networking.firewall.allowedTCPPorts = [ port ];
+    };
+}

Consider giving Nix/NixOS a try! <3