immich: rollback systemd changes

This commit is contained in:
Motiejus Jakštys 2024-09-27 23:20:15 +03:00
parent dc32165b5c
commit 483029dcf3

View File

@ -8,6 +8,7 @@
}: }:
let let
cfg = config.mj.services.immich; cfg = config.mj.services.immich;
immich-package = pkgs.pkgs-unstable.immich;
in in
{ {
options.mj.services.immich = with lib.types; { options.mj.services.immich = with lib.types; {
@ -20,9 +21,9 @@ in
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
services.immich = { services.immich = {
package = immich-package;
enable = true; enable = true;
port = myData.ports.immich-server; port = myData.ports.immich-server;
package = pkgs.pkgs-unstable.immich;
}; };
services.caddy.virtualHosts."photos2.jakstys.lt:80".extraConfig = '' services.caddy.virtualHosts."photos2.jakstys.lt:80".extraConfig = ''
@ -31,14 +32,20 @@ in
''; '';
systemd = { systemd = {
tmpfiles.rules = [ tmpfiles.rules = [ "d /data 0755 root root -" ];
"d /var/cache/immich/userdata 0700 immich immich -"
] ++ lib.mapAttrsToList (name: _: "/var/cache/immich/userdata/${name}") cfg.bindPaths;
services.immich-server.serviceConfig = { services.immich-server.serviceConfig = {
ExecStartPre = lib.mapAttrsToList ( TemporaryFileSystem = "/data";
name: srcpath: PrivateDevices = lib.mkForce false; # /dev/fuse
"+${pkgs.bindfs}/bin/bindfs -u ${cfg.bindAsUser} ${srcpath} /var/cache/immich/userdata/${name}" #ExecStart = ''
) cfg.bindPaths; # ${lib.concatMapStringsSep "\n" (name: "+${pkgs.coreutils}/bin/install -o immich -d /data/${name}") cfg.bindPaths}
# exec ${lib.getExe immich-package}
#'';
# #++ lib.mapAttrsToList (
# # name: srcpath: "+${pkgs.bindfs}/bin/bindfs -u ${cfg.bindAsUser} ${srcpath} /data/${name}"
# #) cfg.bindPaths;
#ExecStopPost = lib.mapAttrsToList (
# name: _: "+${pkgs.util-linux}/bin/umount /data/${name}"
#) cfg.bindPaths;
}; };
}; };