photoprism-test-vm/photoprism.nix

57 lines
1.4 KiB
Nix
Raw Normal View History

2024-11-03 16:55:30 +01:00
{ lib, modulesPath, pkgs, ... }:
{
services.photoprism = {
enable = true;
2024-11-03 16:46:51 +01:00
port = 2342;
settings = {
PHOTOPRISM_DEFAULT_LOCALE = "fr";
PHOTOPRISM_ADMIN_USERNAME = "admin";
2024-11-03 16:46:51 +01:00
PHOHOPRISM_SITE_URL = "https://photoprism.cgiga.fr";
PHOTOPRISM_SITE_CAPTION = "PhotoPrism";
2024-11-03 16:55:30 +01:00
# DB access config
PHOTOPRISM_DATABASE_DRIVER = "mysql";
PHOTOPRISM_DATABASE_NAME = "photoprism";
PHOTOPRISM_DATABASE_SERVER = "/run/mysqld/mysqld.sock";
PHOTOPRISM_DATABASE_USER = "photoprism";
};
2024-11-03 16:50:42 +01:00
originalsPath = "/data/photos";
address = "localhost";
2024-11-03 16:55:30 +01:00
#importPath = "/photoprism/imports";
2024-11-03 16:42:09 +01:00
#passwordFile = "/passwords/photoprism";
};
2024-10-14 14:53:27 +02:00
2024-11-03 16:55:30 +01:00
services.mysql = {
enable = true;
dataDir = "/data/mysql";
package = pkgs.mariadb;
ensureDatabases = [ "photoprism" ];
ensureUsers = [{
name = "photoprism";
ensurePermissions = {
"photoprism.*" = "ALL PRIVILEGES";
};
}];
};
2024-11-03 16:24:07 +01:00
services.nginx.virtualHosts."photoprism.cgiga.fr" = {
2024-10-14 14:53:27 +02:00
enableACME = true;
forceSSL = true;
serverAliases = [];
2024-11-03 16:58:05 +01:00
locations."/" = {
proxyPass = "http://localhost:2342/";
proxyWebsockets = true;
extraConfig = ''
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_buffering off;
proxy_http_version 1.1;
'';
};
2024-10-14 14:53:27 +02:00
};
}