mirror of
https://codeberg.org/muon/home.git
synced 2025-12-06 08:07:45 +00:00
Move photoprism
This commit is contained in:
parent
d8c863ef7a
commit
196b50c629
7 changed files with 51 additions and 36 deletions
46
modules/nixos/server/photoprism.nix
Normal file
46
modules/nixos/server/photoprism.nix
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
|
||||
{ pkgs, lib, config, ... }: {
|
||||
options.mods.server.photoprism = {
|
||||
enable = lib.mkEnableOption {
|
||||
default = false;
|
||||
description = "enables photoprism server";
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
config = lib.mkIf config.mods.server.photoprism.enable {
|
||||
services.photoprism = {
|
||||
enable = true;
|
||||
port = 2342;
|
||||
originalsPath = "/var/lib/private/photoprism/originals";
|
||||
address = "0.0.0.0";
|
||||
settings = {
|
||||
PHOTOPRISM_ADMIN_USER = "admin";
|
||||
PHOTOPRISM_ADMIN_PASSWORD = "CarrotSec";
|
||||
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 = "http://93.95.230.11:2342";
|
||||
PHOTOPRISM_SITE_TITLE = "Giceland Potos";
|
||||
};
|
||||
};
|
||||
|
||||
networking.firewall.allowedTCPPorts = [ 2342 ];
|
||||
|
||||
# MySQL
|
||||
services.mysql = {
|
||||
enable = true;
|
||||
dataDir = "/data/mysql";
|
||||
package = pkgs.mariadb;
|
||||
ensureDatabases = [ "photoprism" ];
|
||||
ensureUsers = [ {
|
||||
name = "photoprism";
|
||||
ensurePermissions = {
|
||||
"photoprism.*" = "ALL PRIVILEGES";
|
||||
};
|
||||
} ];
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue