This commit is contained in:
Joakim Repomaa
2025-02-12 20:58:42 +02:00
parent dd4e5c63e3
commit c519f8d83e
17 changed files with 182 additions and 252 deletions

View File

@@ -1,14 +1,10 @@
{ config, lib, ... }:
let
cfg = config.modules.services.syncthing;
cfg = config.services.syncthing;
fqdn = "${cfg.subdomain}.${config.networking.domain}";
in
{
options.modules.services.syncthing = {
enable = lib.mkEnableOption "Enable Syncthing";
dataDir = lib.mkOption {
type = lib.types.str;
};
options.services.syncthing = {
subdomain = lib.mkOption {
type = lib.types.str;
};
@@ -20,14 +16,12 @@ in
config = lib.mkIf cfg.enable {
services.syncthing = {
enable = true;
dataDir = cfg.dataDir;
openDefaultPorts = true;
guiAddress = "[::1]:${toString cfg.port}";
settings.gui.insecureSkipHostCheck = true;
};
modules.services.webserver = {
services.webserver = {
enable = lib.mkDefault true;
vHosts.${fqdn}.locations."/".proxyPort = cfg.port;
};