lab-infra/machines/photo01/photoprism.nix

55 lines
1.3 KiB
Nix
Raw Normal View History

2024-11-21 18:41:54 +01:00
{ pkgs, ... }:
2024-11-21 18:39:34 +01:00
{
2024-11-21 18:46:03 +01:00
services = {
photoprism = {
enable = true;
port = 2342;
settings = {
PHOTOPRISM_DEFAULT_LOCALE = "fr";
PHOTOPRISM_ADMIN_USERNAME = "admin";
PHOHOPRISM_SITE_URL = "https://photoprism.cgiga.fr";
PHOTOPRISM_SITE_CAPTION = "PhotoPrism";
2024-11-21 18:39:34 +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-21 18:39:34 +01:00
originalsPath = "/data/photos";
2024-11-21 18:39:34 +01:00
address = "localhost";
2024-11-21 18:39:34 +01:00
#importPath = "/photoprism/imports";
passwordFile = "/passwords/photoprism";
};
2024-11-21 18:39:34 +01:00
mysql = {
enable = true;
dataDir = "/data/mysql";
package = pkgs.mariadb;
ensureDatabases = [ "photoprism" ];
ensureUsers = [
{
name = "photoprism";
ensurePermissions = {
"photoprism.*" = "ALL PRIVILEGES";
};
}
];
};
2024-11-21 18:39:34 +01:00
2024-11-21 19:02:40 +01:00
nginx.virtualHosts."photoprism.cgiga.fr" = {
enableACME = true;
forceSSL = true;
serverAliases = [ ];
locations."/" = {
2024-11-21 18:59:56 +01:00
proxyPass = "http://localhost:2342/";
proxyWebsockets = true;
};
2024-11-21 18:39:34 +01:00
};
};
}