lab-infra/machines/photo01/photoprism.nix

59 lines
1.2 KiB
Nix
Raw Normal View History

2024-11-21 18:40:50 +01:00
{
pkgs,
...
}:
2024-11-21 18:39:34 +01:00
2024-11-21 18:40:50 +01:00
let
port = 2342;
2024-11-21 18:39:34 +01:00
in
{
services.photoprism = {
enable = true;
port = port;
settings = {
PHOTOPRISM_DEFAULT_LOCALE = "fr";
PHOTOPRISM_ADMIN_USERNAME = "admin";
PHOHOPRISM_SITE_URL = "https://photoprism.cgiga.fr";
PHOTOPRISM_SITE_CAPTION = "PhotoPrism";
# DB access config
PHOTOPRISM_DATABASE_DRIVER = "mysql";
PHOTOPRISM_DATABASE_NAME = "photoprism";
PHOTOPRISM_DATABASE_SERVER = "/run/mysqld/mysqld.sock";
PHOTOPRISM_DATABASE_USER = "photoprism";
};
originalsPath = "/data/photos";
address = "localhost";
#importPath = "/photoprism/imports";
passwordFile = "/passwords/photoprism";
};
services.mysql = {
enable = true;
dataDir = "/data/mysql";
package = pkgs.mariadb;
ensureDatabases = [ "photoprism" ];
2024-11-21 18:40:50 +01:00
ensureUsers = [
{
name = "photoprism";
ensurePermissions = {
"photoprism.*" = "ALL PRIVILEGES";
};
}
];
2024-11-21 18:39:34 +01:00
};
services.nginx.virtualHosts."photoprism.cgiga.fr" = {
enableACME = true;
forceSSL = true;
2024-11-21 18:40:50 +01:00
serverAliases = [ ];
2024-11-21 18:39:34 +01:00
locations."/" = {
proxyPass = "http://localhost:${toString port}/";
proxyWebsockets = true;
};
};
}