diff options
author | Azat Bahawi <azat@bahawi.net> | 2024-03-31 21:29:27 +0300 |
---|---|---|
committer | Azat Bahawi <azat@bahawi.net> | 2024-03-31 21:29:27 +0300 |
commit | 9a5427e3a0c0ccf2a82dc503149a26b23fbd6004 (patch) | |
tree | f28beec29deeea36038615a8fb98a810891940b5 /modules/nixos/endlessh.nix | |
parent | 2024-03-19 (diff) |
2024-03-31
Diffstat (limited to '')
-rw-r--r-- | modules/nixos/endlessh.nix | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/modules/nixos/endlessh.nix b/modules/nixos/endlessh.nix index caf9a38..f1bf0bc 100644 --- a/modules/nixos/endlessh.nix +++ b/modules/nixos/endlessh.nix @@ -1,16 +1,15 @@ -{ - config, - lib, - ... -}: -with lib; let +{ config, lib, ... }: +with lib; +let cfg = config.nixfiles.modules.endlessh; -in { +in +{ options.nixfiles.modules.endlessh.enable = mkEnableOption "endlessh"; - config = let - port = 22; - in + config = + let + port = 22; + in mkIf cfg.enable { ark.directories = [ "/var/lib/gotify-server" @@ -20,9 +19,12 @@ in { services.endlessh = { enable = true; inherit port; - extraOptions = ["-v" "-4"]; + extraOptions = [ + "-v" + "-4" + ]; }; - networking.firewall.allowedTCPPorts = [port]; + networking.firewall.allowedTCPPorts = [ port ]; }; } |