mirror of
https://git.sr.ht/~rouven/nixos-config
synced 2024-11-16 05:43:10 +01:00
30 lines
809 B
Nix
30 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";
|
||
|
};
|
||
|
services.nginx.virtualHosts."${domain}" = {
|
||
|
enableACME = true;
|
||
|
forceSSL = true;
|
||
|
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;
|
||
|
};
|
||
|
};
|
||
|
}
|