Files
sydnix/modules/nixos/deertopia/syncthing.nix
2025-04-01 07:28:38 -06:00

50 lines
1.2 KiB
Nix

{ config, lib, pkgs, ... }:
let cfg = config.sydnix.deertopia.syncthing;
in {
options.sydnix.deertopia.syncthing.enable =
lib.mkEnableOption "Syncthing, à la Deertopia";
config = lib.mkIf cfg.enable {
sydnix.syncthing = {
enable = true;
includeDevices = [
"sydpc"
"nixos-testbed"
];
directories = {
"Music" = {
path = "/persist/vault/jellyfin/Music";
ignorePerms = true;
devices = [
"sydpc"
];
};
"org" = {
path = "/persist/deertopia.net/dav/org";
ignorePerms = true;
devices = [
"sydpc"
];
};
};
};
# HACK: I don't understand the idioms of Unix file permissions.
# TODO: Consult molly for this shit TwT.
users.users.${config.services.syncthing.user}.extraGroups = [
"jellyfin"
"nginx"
];
sydnix.deertopia.nginx.vhosts."syncthing".vhost = {
forceSSL = true;
enableACME = true;
locations."/" = {
# TODO: This should work if guiAddress already specifies a protocol.
proxyPass = "http://" + config.services.syncthing.guiAddress;
};
};
};
}