Add photoprism properly
This commit is contained in:
parent
b2b1df3cda
commit
5c5daa49b7
7 changed files with 54 additions and 15 deletions
|
@ -3,8 +3,9 @@
|
|||
enable = true;
|
||||
package = pkgs.mariadb;
|
||||
dataDir = "/var/lib/mysql";
|
||||
initialDatabases = [
|
||||
{ name = "minecraft"; }
|
||||
ensureDatabases = [
|
||||
"minecraft"
|
||||
"photoprism"
|
||||
];
|
||||
ensureUsers = [
|
||||
{
|
||||
|
@ -13,6 +14,12 @@
|
|||
"minecraft.*" = "ALL PRIVILEGES";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "photoprism";
|
||||
ensurePermissions = {
|
||||
"photoprism.*" = "ALL PRIVILEGES";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
30
nixos/server/photoprism.nix
Normal file
30
nixos/server/photoprism.nix
Normal file
|
@ -0,0 +1,30 @@
|
|||
{outputs, ...}: {
|
||||
# Photoprism
|
||||
services = {
|
||||
photoprism = {
|
||||
enable = true;
|
||||
port = 2342;
|
||||
originalsPath = "/var/lib/private/photoprism/originals";
|
||||
address = "0.0.0.0";
|
||||
settings = {
|
||||
PHOTOPRISM_ADMIN_USER = "jimbo";
|
||||
PHOTOPRISM_ADMIN_PASSWORD = "${outputs.secrets.prismAdminPass}";
|
||||
PHOTOPRISM_DEFAULT_LOCALE = "en";
|
||||
PHOTOPRISM_DATABASE_DRIVER = "mysql";
|
||||
PHOTOPRISM_DATABASE_NAME = "photoprism";
|
||||
PHOTOPRISM_DATABASE_SERVER = "/run/mysqld/mysqld.sock";
|
||||
PHOTOPRISM_DATABASE_USER = "photoprism";
|
||||
PHOTOPRISM_SITE_URL = "https://gallery.${outputs.secrets.jimDomain}";
|
||||
PHOTOPRISM_SITE_TITLE = "Jimbo's PhotoPrism";
|
||||
};
|
||||
};
|
||||
nginx.virtualHosts."gallery.${outputs.secrets.jimDomain}" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://127.0.0.1:2342";
|
||||
proxyWebsockets = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -25,10 +25,6 @@ in {
|
|||
publicKey = outputs.secrets.wirePixel9Pub;
|
||||
allowedIPs = [ "10.100.0.2/32" ];
|
||||
}
|
||||
{ # Jimbo Pixel 4
|
||||
publicKey = outputs.secrets.wirePixel4Pub;
|
||||
allowedIPs = [ "10.100.0.3/32" ];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue