2024-11-03 16:55:30 +01:00
|
|
|
{ lib, modulesPath, pkgs, ... }:
|
2024-10-09 00:04:46 +02:00
|
|
|
|
2024-11-03 17:10:07 +01:00
|
|
|
let port = 2342;
|
|
|
|
in
|
2024-10-09 00:04:46 +02:00
|
|
|
{
|
|
|
|
services.photoprism = {
|
|
|
|
enable = true;
|
2024-11-03 17:10:07 +01:00
|
|
|
port = port;
|
2024-10-09 00:04:46 +02:00
|
|
|
settings = {
|
|
|
|
PHOTOPRISM_DEFAULT_LOCALE = "fr";
|
|
|
|
PHOTOPRISM_ADMIN_USERNAME = "admin";
|
2024-11-03 16:46:51 +01:00
|
|
|
PHOHOPRISM_SITE_URL = "https://photoprism.cgiga.fr";
|
2024-10-09 00:04:46 +02:00
|
|
|
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-10-09 00:04:46 +02:00
|
|
|
};
|
|
|
|
|
2024-11-03 16:50:42 +01:00
|
|
|
originalsPath = "/data/photos";
|
2024-10-09 00:04:46 +02:00
|
|
|
|
2024-10-09 17:06:24 +02:00
|
|
|
address = "localhost";
|
|
|
|
|
2024-11-03 16:55:30 +01:00
|
|
|
#importPath = "/photoprism/imports";
|
2024-11-03 17:13:45 +01:00
|
|
|
passwordFile = "/passwords/photoprism";
|
2024-10-09 00:04:46 +02:00
|
|
|
};
|
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."/" = {
|
2024-11-03 17:10:07 +01:00
|
|
|
proxyPass = "http://localhost:${toString port}/";
|
2024-11-03 16:58:05 +01:00
|
|
|
proxyWebsockets = true;
|
|
|
|
};
|
2024-10-14 14:53:27 +02:00
|
|
|
};
|
2024-10-09 00:04:46 +02:00
|
|
|
}
|