helm/hosts/profiles/photoprism/default.nix

49 lines
1.4 KiB
Nix
Raw Normal View History

2023-05-13 21:42:23 -07:00
{ self, pkgs, config, lib, ... }:
{
services.postgresql = {
enable = true;
ensureDatabases = [ "photoprism" ];
ensureUsers = [{
name = "photoprism";
ensurePermissions = {
"DATABASE photoprism" = "ALL PRIVILEGES";
};
}];
};
services.photoprism = {
enable = true;
package = pkgs.unstable.photoprism;
2023-05-15 07:19:09 -07:00
port = 5152;
2023-05-13 21:42:23 -07:00
originalsPath = "/var/lib/private/photoprism/originals";
address = "0.0.0.0";
settings = {
PHOTOPRISM_ADMIN_USER = "admin";
2023-05-15 07:19:09 -07:00
PHOTOPRISM_ADMIN_PASSWORD = "photoprism"; # initial password, do change it!
2023-05-13 21:42:23 -07:00
PHOTOPRISM_DEFAULT_LOCALE = "en";
PHOTOPRISM_DATABASE_DRIVER = "postgres";
PHOTOPRISM_DATABASE_NAME = "photoprism";
PHOTOPRISM_DATABASE_SERVER = "/run/postgresql/";
PHOTOPRISM_DATABASE_USER = "photoprism";
2023-05-15 07:19:09 -07:00
PHOTOPRISM_SITE_URL = "http://photos.mossnet.lan/";
2023-05-13 21:42:23 -07:00
PHOTOPRISM_SITE_TITLE = "mossnet photos";
};
};
2023-05-15 07:19:09 -07:00
services.nginx.clientMaxBodySize = "500m";
services.nginx.recommendedProxySettings = true;
2023-05-13 21:42:23 -07:00
services.nginx.virtualHosts."photos.mossnet.lan" = {
enableACME = false;
forceSSL = false;
locations."/" = {
extraConfig = ''
2023-05-15 07:19:09 -07:00
proxy_pass http://localhost:5152/;
2023-05-13 21:42:23 -07:00
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_buffering off;
proxy_http_version 1.1;
'';
};
};
}