photoprism-test-vm/photoprism.nix

53 lines
1.2 KiB
Nix
Raw Normal View History

2024-11-03 16:55:30 +01:00
{ lib, modulesPath, pkgs, ... }:
let port = 2342;
in
{
services.photoprism = {
enable = true;
port = port;
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";
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:${toString port}/";
2024-11-03 16:58:05 +01:00
proxyWebsockets = true;
};
2024-10-14 14:53:27 +02:00
};
}