feat(deertopia): Add Copyparty module

This commit is contained in:
Madeleine Sydney
2025-02-24 05:22:18 -07:00
parent c8ba339b4b
commit c460157918
5 changed files with 130 additions and 29 deletions

View File

@@ -0,0 +1,54 @@
{ config, lib, pkgs, ... }@inputs:
let cfg = config.sydnix.deertopia.copyparty;
in {
options.sydnix.deertopia.copyparty = {
enable = lib.mkEnableOption "Copyparty";
port = lib.mkOption {
type = lib.types.port;
description = ''
Port on which Copyparty is to listen.
'';
default = 3923;
};
};
config = lib.mkIf cfg.enable {
sydnix.impermanence.directories = [
];
nixpkgs.overlays = [ inputs.copyparty.overlays.default ];
services.copyparty = {
enable = true;
settings = {
xff-src = "lan";
idp-h-usr = "remote-user";
idp-h-grp = "remote-groups";
};
volumes = {
"/Jellyfin" = {
path = "/persist/vault/jellyfin";
# View and upload, but no deleting.
access.rw = "*";
};
};
};
sydnix.deertopia.nginx.vhosts."files" = {
directory = null;
vhost = {
forceSSL = true;
enableACME = true;
extraConfig = ''
include ${./authelia/authelia-location.conf};
'';
locations."/".extraConfig = ''
include ${./authelia/authelia-authrequest.conf};
include ${./authelia/proxy.conf};
proxy_pass http://localhost:${builtins.toString cfg.port};
'';
};
};
};
}