mirror of
https://git.sr.ht/~rouven/nixos-config
synced 2024-11-15 13:23:11 +01:00
29 lines
809 B
Nix
29 lines
809 B
Nix
{ 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";
|
|
seafileSettings.fileserver.port = 8083;
|
|
};
|
|
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;
|
|
};
|
|
};
|
|
}
|