feat: add database config
This commit is contained in:
parent
9a153603ee
commit
1b13296783
1 changed files with 22 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
||||||
{ lib, modulesPath, ... }:
|
{ lib, modulesPath, pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
services.photoprism = {
|
services.photoprism = {
|
||||||
|
@ -9,16 +9,36 @@
|
||||||
PHOTOPRISM_ADMIN_USERNAME = "admin";
|
PHOTOPRISM_ADMIN_USERNAME = "admin";
|
||||||
PHOHOPRISM_SITE_URL = "https://photoprism.cgiga.fr";
|
PHOHOPRISM_SITE_URL = "https://photoprism.cgiga.fr";
|
||||||
PHOTOPRISM_SITE_CAPTION = "PhotoPrism";
|
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";
|
originalsPath = "/data/photos";
|
||||||
#importPath = "/photoprism/imports";
|
|
||||||
|
|
||||||
address = "localhost";
|
address = "localhost";
|
||||||
|
|
||||||
|
#importPath = "/photoprism/imports";
|
||||||
#passwordFile = "/passwords/photoprism";
|
#passwordFile = "/passwords/photoprism";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
services.mysql = {
|
||||||
|
enable = true;
|
||||||
|
dataDir = "/data/mysql";
|
||||||
|
package = pkgs.mariadb;
|
||||||
|
ensureDatabases = [ "photoprism" ];
|
||||||
|
ensureUsers = [{
|
||||||
|
name = "photoprism";
|
||||||
|
ensurePermissions = {
|
||||||
|
"photoprism.*" = "ALL PRIVILEGES";
|
||||||
|
};
|
||||||
|
}];
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
services.nginx.virtualHosts."photoprism.cgiga.fr" = {
|
services.nginx.virtualHosts."photoprism.cgiga.fr" = {
|
||||||
enableACME = true;
|
enableACME = true;
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
|
|
Loading…
Reference in a new issue