52 lines
1.4 KiB
Nix
52 lines
1.4 KiB
Nix
|
{ self, pkgs, config, lib, ... }:
|
||
|
|
||
|
{
|
||
|
services.postgresql = {
|
||
|
enable = true;
|
||
|
ensureDatabases = [ "photoprism" ];
|
||
|
ensureUsers = [{
|
||
|
name = "photoprism";
|
||
|
ensurePermissions = {
|
||
|
"DATABASE photoprism" = "ALL PRIVILEGES";
|
||
|
};
|
||
|
}];
|
||
|
};
|
||
|
|
||
|
services.photoprism = {
|
||
|
enable = true;
|
||
|
port = 2342;
|
||
|
originalsPath = "/var/lib/private/photoprism/originals";
|
||
|
address = "0.0.0.0";
|
||
|
settings = {
|
||
|
PHOTOPRISM_ADMIN_USER = "admin";
|
||
|
PHOTOPRISM_ADMIN_PASSWORD = "...";
|
||
|
PHOTOPRISM_DEFAULT_LOCALE = "en";
|
||
|
PHOTOPRISM_DATABASE_DRIVER = "postgres";
|
||
|
PHOTOPRISM_DATABASE_NAME = "photoprism";
|
||
|
PHOTOPRISM_DATABASE_SERVER = "/run/postgresql/";
|
||
|
PHOTOPRISM_DATABASE_USER = "photoprism";
|
||
|
PHOTOPRISM_SITE_URL = "http://photos.mossnet.lan:2342";
|
||
|
PHOTOPRISM_SITE_TITLE = "mossnet photos";
|
||
|
};
|
||
|
};
|
||
|
|
||
|
services.nginx.virtualHosts."photos.mossnet.lan" = {
|
||
|
enableACME = false;
|
||
|
forceSSL = false;
|
||
|
recommendedOptimisation = true;
|
||
|
recommendedGzipSettings = true;
|
||
|
recommendedProxySettings = true;
|
||
|
clientMaxBodySize = "500m";
|
||
|
locations."/" = {
|
||
|
proxyPass = "http://127.0.0.1:2342";
|
||
|
extraConfig = ''
|
||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||
|
proxy_buffering off;
|
||
|
proxy_http_version 1.1;
|
||
|
proxy_set_header Upgrade $http_upgrade;
|
||
|
proxy_set_header Connection "upgrade";
|
||
|
'';
|
||
|
};
|
||
|
};
|
||
|
}
|