nixos-config/hosts/nuc/modules/seafile/default.nix

29 lines
809 B
Nix
Raw Normal View History

2023-10-15 16:30:40 +02:00
{ config, pkgs, ... }:
let
domain = "seafile.${config.networking.domain}";
in
{
services.seafile = {
enable = true;
adminEmail = "rouven@rfive.de";
initialAdminPassword = "unused garbage";
ccnetSettings.General.SERVICE_URL = "https://${domain}";
ccnetSettings.General.FILE_SERVER_ROOT = "https://${domain}/seafhttp";
2024-02-29 15:37:22 +01:00
seafileSettings.fileserver.port = 8083;
2023-10-15 16:30:40 +02:00
};
services.nginx.virtualHosts."${domain}" = {
locations."/" = {
proxyPass = "http://unix:/run/seahub/gunicorn.sock";
};
locations."/seafhttp" = {
proxyPass = "http://127.0.0.1:${toString config.services.seafile.seafileSettings.fileserver.port}";
extraConfig = ''
rewrite ^/seafhttp(.*)$ $1 break;
'';
};
locations."/media" = {
root = pkgs.seahub;
};
};
}