refactor(syncthing): Refactor syncthing modules

This commit is contained in:
Madeleine Sydney
2025-03-10 15:16:47 -06:00
parent 4f5abf4826
commit 5f80bfc5c8
5 changed files with 187 additions and 121 deletions

View File

@@ -0,0 +1,47 @@
{ 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 = [
"guix-rebound"
"nixos-testbed"
];
directories = {
"Music" = {
path = "/persist/vault/jellyfin/Music";
devices = [ "guix-rebound" ];
ignorePerms = true;
};
"org" = {
path = "/persist/deertopia.net/dav/org";
devices = [
"guix-rebound"
"nixos-testbed"
];
ignorePerms = true;
};
};
};
# 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;
};
};
};
}