add photoprism on orbi

This commit is contained in:
Ingolf Wagner 2024-05-10 20:53:21 +02:00
parent 60140abca2
commit 2a96cc02d3
No known key found for this signature in database
GPG key ID: 76BF5F1928B9618B
5 changed files with 79 additions and 1 deletions

View file

@ -24,6 +24,7 @@ let
"sonarr.orbi" = hosts.orbi;
"radarr.orbi" = hosts.orbi;
"prowlarr.orbi" = hosts.orbi;
"photoprism.orbi" = hosts.orbi;
# robi
"grafana.robi" = hosts.robi;
"loki.robi" = hosts.robi;

View file

@ -10,6 +10,7 @@ with lib;
options = [
"name"
"mountpoint"
"compression"
"com.sun:auto-snapshot:yearly"
"com.sun:auto-snapshot:monthly"
"com.sun:auto-snapshot:daily"

View file

@ -13,6 +13,7 @@
./service-forgejo.nix
./service-vaultwarden.nix
./service-taskserver.nix
#./service-photoprism.nix
./nginx-ingolf-wagner-de.nix
./nginx-wkd.nix

View file

@ -123,7 +123,7 @@ in
canmount = "off";
};
datasets = {
"media" = {
media = {
type = "zfs_fs";
mountpoint = "/media";
options = {
@ -134,6 +134,18 @@ in
#"com.sun:auto-snapshot:monthly" = false;
};
};
#photoprism = {
# type = "zfs_fs";
# mountpoint = "/var/lib/nixos-containers/photoprism";
# options = {
# mountpoint = "legacy";
# compression = "lz4";
# "com.sun:auto-snapshot:hourly" = toString true;
# "com.sun:auto-snapshot:daily" = toString true;
# #"com.sun:auto-snapshot:weekly" = false;
# #"com.sun:auto-snapshot:monthly" = false;
# };
#};
};
};

View file

@ -0,0 +1,63 @@
{ config, pkgs, lib, ... }:
let
mySQLPackage = pkgs.mysql;
photoprismPort = 2342;
mysqlPort = 3336;
in
{
containers.photoprism = {
privateNetwork = false;
autoStart = true;
config = { config, pkgs, lib, ... }: {
system.stateVersion = "23.11";
# Photoprism
# ----------
services.photoprism = {
enable = true;
port = photoprismPort;
originalsPath = "/var/lib/private/photoprism/originals";
address = "0.0.0.0";
settings = {
PHOTOPRISM_ADMIN_USER = "admin";
PHOTOPRISM_ADMIN_PASSWORD = "...";
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://photoprism.orbi.private:${toString photoprismPort}";
PHOTOPRISM_SITE_TITLE = "PhotoPrism";
};
};
# MySQL Database
# --------------
services.mysql = {
enable = true;
package = mySQLPackage;
settings.mysqld.port = mysqlPort;
ensureDatabases = [ "photoprism" ];
ensureUsers = [{
name = "photoprism";
ensurePermissions = {
"photoprism.*" = "ALL PRIVILEGES";
};
}];
};
# Backup Database
# ---------------
services.mysqlBackup = {
enable = true;
databases = config.services.mysql.ensureDatabases;
singleTransaction = true;
};
};
};
}