feat(deertopia): Add Copyparty module
This commit is contained in:
54
modules/nixos/deertopia/copyparty.nix
Normal file
54
modules/nixos/deertopia/copyparty.nix
Normal 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};
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user