diff --git a/hosts/fwminex/configuration.nix b/hosts/fwminex/configuration.nix index d77e05d..0c26acb 100644 --- a/hosts/fwminex/configuration.nix +++ b/hosts/fwminex/configuration.nix @@ -127,7 +127,6 @@ in }; }; - #syncthing-relay.restartIfChanged = false; }; paths = { @@ -299,27 +298,23 @@ in job_name = "caddy"; static_configs = [ { targets = [ "127.0.0.1:${toString myData.ports.exporters.caddy}" ]; } ]; } - { - job_name = "${config.networking.hostName}.${config.networking.domain}"; - static_configs = [ { targets = [ "127.0.0.1:${port}" ]; } ]; - } - { - job_name = "fra1-b.servers.jakst"; - static_configs = [ { targets = [ "${myData.hosts."fra1-b.servers.jakst".jakstIP}:${port}" ]; } ]; - } - { - job_name = "vno3-rp3b.servers.jakst"; - static_configs = [ { targets = [ "${myData.hosts."vno3-rp3b.servers.jakst".jakstIP}:${port}" ]; } ]; - } - { - job_name = "mtworx.motiejus.jakst"; - static_configs = [ { targets = [ "${myData.hosts."mtworx.motiejus.jakst".jakstIP}:${port}" ]; } ]; - } { job_name = "vno1-vinc.vincentas.jakst"; static_configs = [ { targets = [ "${myData.hosts."vno1-vinc.vincentas.jakst".jakstIP}:9100" ]; } ]; } - ]; + ] + ++ + map + (s: { + job_name = s; + static_configs = [ { targets = [ "${myData.hosts.${s}.jakstIP}:${port}" ]; } ]; + }) + [ + "fra1-b.servers.jakst" + "fwminex.servers.jakst" + "mtworx.motiejus.jakst" + "vno3-rp3b.servers.jakst" + ]; }; }; @@ -346,6 +341,7 @@ in sshguard.enable = true; gitea.enable = true; hass.enable = true; + syncthing-relay.enable = true; vaultwarden = { enable = true; @@ -566,8 +562,6 @@ in 53 80 443 - #config.services.syncthing.relay.port - #config.services.syncthing.relay.statusPort ]; }; }; diff --git a/modules/services/default.nix b/modules/services/default.nix index a4afca1..955589c 100644 --- a/modules/services/default.nix +++ b/modules/services/default.nix @@ -19,6 +19,7 @@ ./remote-builder ./sshguard ./syncthing + ./syncthing-relay ./tailscale ./vaultwarden ./wifibackup diff --git a/modules/services/syncthing-relay/default.nix b/modules/services/syncthing-relay/default.nix new file mode 100644 index 0000000..604decf --- /dev/null +++ b/modules/services/syncthing-relay/default.nix @@ -0,0 +1,23 @@ +{ config, lib, ... }: +let + cfg = config.mj.services.syncthing-relay; +in +{ + options.mj.services.syncthing-relay = with lib.types; { + enable = lib.mkEnableOption "enable syncthing-relay"; + }; + + config = lib.mkIf cfg.enable { + services.syncthing.relay = { + enable = true; + providedBy = "jakstys.lt"; + }; + systemd.services.syncthing-relay.restartIfChanged = false; + + networking.firewall.allowedTCPPorts = [ + config.services.syncthing.relay.port + config.services.syncthing.relay.statusPort + ]; + }; + +}