add photoprism on orbi
This commit is contained in:
parent
60140abca2
commit
2a96cc02d3
5 changed files with 79 additions and 1 deletions
|
@ -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;
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
./service-forgejo.nix
|
||||
./service-vaultwarden.nix
|
||||
./service-taskserver.nix
|
||||
#./service-photoprism.nix
|
||||
|
||||
./nginx-ingolf-wagner-de.nix
|
||||
./nginx-wkd.nix
|
||||
|
|
|
@ -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;
|
||||
# };
|
||||
#};
|
||||
};
|
||||
};
|
||||
|
||||
|
|
63
nixos/machines/orbi/service-photoprism.nix
Normal file
63
nixos/machines/orbi/service-photoprism.nix
Normal 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;
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
}
|
Loading…
Reference in a new issue