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-go.nix | |
parent | 2024-03-19 (diff) |
2024-03-31
Diffstat (limited to '')
-rw-r--r-- | modules/nixos/endlessh-go.nix | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/modules/nixos/endlessh-go.nix b/modules/nixos/endlessh-go.nix index 435305d..efaaa8f 100644 --- a/modules/nixos/endlessh-go.nix +++ b/modules/nixos/endlessh-go.nix @@ -4,14 +4,17 @@ this, ... }: -with lib; let +with lib; +let cfg = config.nixfiles.modules.endlessh-go; -in { +in +{ options.nixfiles.modules.endlessh-go.enable = mkEnableOption "endlessh-go"; - config = let - port = 22; - in + config = + let + port = 22; + in mkIf cfg.enable { services.endlessh-go = { enable = true; @@ -22,9 +25,12 @@ in { listenAddress = this.wireguard.ipv4.address; port = 9229; }; - extraOptions = ["-geoip_supplier=ip-api" "-v=1"]; + extraOptions = [ + "-geoip_supplier=ip-api" + "-v=1" + ]; }; - networking.firewall.allowedTCPPorts = [port]; + networking.firewall.allowedTCPPorts = [ port ]; }; } |