work on photoprism
This commit is contained in:
parent
734f8e5dcb
commit
ede701532d
|
@ -1,4 +1,9 @@
|
||||||
{lib, config, pkgs, ...}: let
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
inherit (config.services.secrets) secrets;
|
inherit (config.services.secrets) secrets;
|
||||||
|
|
||||||
rclonePhotos = pkgs.writeShellScriptBin "rclone-photos" ''
|
rclonePhotos = pkgs.writeShellScriptBin "rclone-photos" ''
|
||||||
|
@ -30,6 +35,27 @@ in {
|
||||||
fuse3
|
fuse3
|
||||||
mountPhotos
|
mountPhotos
|
||||||
util-linux
|
util-linux
|
||||||
|
(let
|
||||||
|
cfg = config.services.photoprism;
|
||||||
|
|
||||||
|
env =
|
||||||
|
{
|
||||||
|
PHOTOPRISM_ORIGINALS_PATH = cfg.originalsPath;
|
||||||
|
PHOTOPRISM_STORAGE_PATH = cfg.storagePath;
|
||||||
|
PHOTOPRISM_IMPORT_PATH = cfg.importPath;
|
||||||
|
PHOTOPRISM_HTTP_HOST = cfg.address;
|
||||||
|
PHOTOPRISM_HTTP_PORT = toString cfg.port;
|
||||||
|
}
|
||||||
|
// (lib.mapAttrs (_: toString) cfg.settings);
|
||||||
|
in
|
||||||
|
pkgs.writeShellScript "photoprism-manage" ''
|
||||||
|
set -o allexport
|
||||||
|
${lib.toShellVars env}
|
||||||
|
eval "$(${config.systemd.package}/bin/systemctl show -pUID,MainPID photoprism.service | ${pkgs.gnused}/bin/sed "s/UID/ServiceUID/")"
|
||||||
|
exec ${pkgs.util-linux}/bin/nsenter \
|
||||||
|
-t $MainPID -m -S $ServiceUID -G $ServiceUID --wdns=${cfg.storagePath} \
|
||||||
|
${cfg.package}/bin/photoprism "$@"
|
||||||
|
'')
|
||||||
];
|
];
|
||||||
|
|
||||||
systemd.tmpfiles.rules = [
|
systemd.tmpfiles.rules = [
|
||||||
|
@ -50,6 +76,8 @@ in {
|
||||||
settings = {
|
settings = {
|
||||||
PHOTOPRISM_SITE_URL = "https://photoprism.owo.monster";
|
PHOTOPRISM_SITE_URL = "https://photoprism.owo.monster";
|
||||||
PHOTOPRISM_ADMIN_PASSWORD = "adminadmin";
|
PHOTOPRISM_ADMIN_PASSWORD = "adminadmin";
|
||||||
|
PHOTOPRISM_DETECT_NSFW = false;
|
||||||
|
PHOTOPRISM_UPLOAD_NSFW = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -76,4 +104,4 @@ in {
|
||||||
];
|
];
|
||||||
serviceConfig.ExecStart = "${mountPhotos}/bin/mount-photos --syslog";
|
serviceConfig.ExecStart = "${mountPhotos}/bin/mount-photos --syslog";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,7 +66,6 @@
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|
||||||
secrets = {
|
secrets = {
|
||||||
vault_password = {
|
vault_password = {
|
||||||
manual = true;
|
manual = true;
|
||||||
|
|
Loading…
Reference in a new issue