immich: +bindPaths wip

This commit is contained in:
Motiejus Jakštys 2024-09-27 20:04:41 +03:00
parent 26ca91301b
commit dc32165b5c
2 changed files with 15 additions and 12 deletions

View File

@ -443,7 +443,8 @@ in
immich = { immich = {
enable = true; enable = true;
paths = { bindAsUser = "motiejus";
bindPaths = {
"M-Camera" = "/home/motiejus/annex2/M-Active"; "M-Camera" = "/home/motiejus/annex2/M-Active";
"Pictures" = "/home/motiejus/annex2/Pictures"; "Pictures" = "/home/motiejus/annex2/Pictures";
}; };

View File

@ -12,7 +12,8 @@ in
{ {
options.mj.services.immich = with lib.types; { options.mj.services.immich = with lib.types; {
enable = lib.mkEnableOption "enable immich"; 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" ]; imports = [ "${nixpkgs-unstable}/nixos/modules/services/web-apps/immich.nix" ];
@ -29,16 +30,17 @@ in
reverse_proxy localhost:${toString myData.ports.immich-server} reverse_proxy localhost:${toString myData.ports.immich-server}
''; '';
#systemd = { systemd = {
# #tmpfiles.rules = [ "d /var/cache/immich/userdata 0700 immich immich -" ]; tmpfiles.rules = [
# services.immich-server.serviceConfig = { "d /var/cache/immich/userdata 0700 immich immich -"
# #ProtectHome = lib.mkForce "tmpfs"; ] ++ lib.mapAttrsToList (name: _: "/var/cache/immich/userdata/${name}") cfg.bindPaths;
# #CacheDirectory = "immich"; services.immich-server.serviceConfig = {
# #BindPaths = lib.mapAttrsToList ( ExecStartPre = lib.mapAttrsToList (
# # name: srcpath: "${srcpath}:/var/cache/immich/userdata/${name}" name: srcpath:
# #) cfg.paths; "+${pkgs.bindfs}/bin/bindfs -u ${cfg.bindAsUser} ${srcpath} /var/cache/immich/userdata/${name}"
# }; ) cfg.bindPaths;
#}; };
};
}; };