services: added synthing option

This commit is contained in:
Tigor Hutasuhut 2024-06-14 10:04:29 +07:00
parent 7f12cb9bdc
commit 69fa74b1d5
4 changed files with 26 additions and 1 deletions

View file

@ -1,6 +1,6 @@
{ lib, ... }:
let
inherit (lib) mkEnableOption;
inherit (lib) mkEnableOption mkOption types;
in
{
options.profile.services = {
@ -10,5 +10,6 @@ in
kavita.enable = mkEnableOption "kavita";
samba.enable = mkEnableOption "samba";
nextcloud.enable = mkEnableOption "nextcloud";
syncthing.enable = mkEnableOption "syncthing";
};
}

View file

@ -34,6 +34,7 @@
kavita.enable = true;
samba.enable = true;
nextcloud.enable = true;
syncthing.enable = true;
};
};
}

View file

@ -6,5 +6,6 @@
./forgejo.nix
./samba.nix
./nextcloud.nix
./syncthing.nix
];
}

View file

@ -0,0 +1,22 @@
{ config, lib, ... }:
let
cfg = config.profile.services.syncthing;
inherit (lib) mkIf;
in
{
config = mkIf cfg.enable {
services.caddy.virtualHosts."syncthing.tigor.web.id".extraConfig = ''
reverse_proxy 0.0.0.0:8384
'';
services.syncthing = {
enable = true;
settings = {
options.urAccepted = 1; # Allow anonymous usage reporting.
};
overrideFolders = false;
overrideDevices = false;
openDefaultPorts = true;
guiAddress = "0.0.0.0:8384";
};
};
}