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;
|
||||
|
||||
rclonePhotos = pkgs.writeShellScriptBin "rclone-photos" ''
|
||||
|
@ -30,6 +35,27 @@ in {
|
|||
fuse3
|
||||
mountPhotos
|
||||
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 = [
|
||||
|
@ -50,6 +76,8 @@ in {
|
|||
settings = {
|
||||
PHOTOPRISM_SITE_URL = "https://photoprism.owo.monster";
|
||||
PHOTOPRISM_ADMIN_PASSWORD = "adminadmin";
|
||||
PHOTOPRISM_DETECT_NSFW = false;
|
||||
PHOTOPRISM_UPLOAD_NSFW = true;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -66,7 +66,6 @@
|
|||
}
|
||||
'';
|
||||
|
||||
|
||||
secrets = {
|
||||
vault_password = {
|
||||
manual = true;
|
||||
|
|
Loading…
Reference in a new issue