immich: +bindPaths wip
This commit is contained in:
parent
26ca91301b
commit
dc32165b5c
@ -443,7 +443,8 @@ in
|
||||
|
||||
immich = {
|
||||
enable = true;
|
||||
paths = {
|
||||
bindAsUser = "motiejus";
|
||||
bindPaths = {
|
||||
"M-Camera" = "/home/motiejus/annex2/M-Active";
|
||||
"Pictures" = "/home/motiejus/annex2/Pictures";
|
||||
};
|
||||
|
@ -12,7 +12,8 @@ in
|
||||
{
|
||||
options.mj.services.immich = with lib.types; {
|
||||
enable = lib.mkEnableOption "enable immich";
|
||||
paths = lib.mkOption { type = attrsOf str; };
|
||||
bindPaths = lib.mkOption { type = attrsOf str; };
|
||||
bindAsUser = lib.mkOption { type = str; };
|
||||
};
|
||||
|
||||
imports = [ "${nixpkgs-unstable}/nixos/modules/services/web-apps/immich.nix" ];
|
||||
@ -29,16 +30,17 @@ in
|
||||
reverse_proxy localhost:${toString myData.ports.immich-server}
|
||||
'';
|
||||
|
||||
#systemd = {
|
||||
# #tmpfiles.rules = [ "d /var/cache/immich/userdata 0700 immich immich -" ];
|
||||
# services.immich-server.serviceConfig = {
|
||||
# #ProtectHome = lib.mkForce "tmpfs";
|
||||
# #CacheDirectory = "immich";
|
||||
# #BindPaths = lib.mapAttrsToList (
|
||||
# # name: srcpath: "${srcpath}:/var/cache/immich/userdata/${name}"
|
||||
# #) cfg.paths;
|
||||
# };
|
||||
#};
|
||||
systemd = {
|
||||
tmpfiles.rules = [
|
||||
"d /var/cache/immich/userdata 0700 immich immich -"
|
||||
] ++ lib.mapAttrsToList (name: _: "/var/cache/immich/userdata/${name}") cfg.bindPaths;
|
||||
services.immich-server.serviceConfig = {
|
||||
ExecStartPre = lib.mapAttrsToList (
|
||||
name: srcpath:
|
||||
"+${pkgs.bindfs}/bin/bindfs -u ${cfg.bindAsUser} ${srcpath} /var/cache/immich/userdata/${name}"
|
||||
) cfg.bindPaths;
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user