wip immich mounts

This commit is contained in:
Motiejus Jakštys 2024-09-29 19:47:40 +03:00
parent 6589315cde
commit 75a7281dce

View File

@ -9,6 +9,24 @@
let let
cfg = config.mj.services.immich; cfg = config.mj.services.immich;
immich-package = pkgs.pkgs-unstable.immich; immich-package = pkgs.pkgs-unstable.immich;
startScript = pkgs.writeShellApplication {
name = "immich-mj";
runtimeInputs = with pkgs; [
sudo
bindfs
util-linux
];
text = ''
${lib.concatLines (
lib.mapAttrsToList (name: srcpath: ''
#mkdir /data/${name}
#bindfs -u ${cfg.bindAsUser} ${srcpath} /data/${name}
'') cfg.bindPaths
)}
#exec sudo -u ${config.services.immich.user} -- ${lib.getExe immich-package}
exec ${lib.getExe immich-package}
'';
};
in in
{ {
options.mj.services.immich = with lib.types; { options.mj.services.immich = with lib.types; {
@ -36,16 +54,12 @@ in
services.immich-server.serviceConfig = { services.immich-server.serviceConfig = {
TemporaryFileSystem = "/data"; TemporaryFileSystem = "/data";
PrivateDevices = lib.mkForce false; # /dev/fuse PrivateDevices = lib.mkForce false; # /dev/fuse
#ExecStart = '' ProtectHome = lib.mkForce false; # binding /home/motiejus
# ${lib.concatMapStringsSep "\n" (name: "+${pkgs.coreutils}/bin/install -o immich -d /data/${name}") cfg.bindPaths}
# exec ${lib.getExe immich-package} # testing
#''; PrivateMounts = lib.mkForce false;
# #++ lib.mapAttrsToList (
# # name: srcpath: "+${pkgs.bindfs}/bin/bindfs -u ${cfg.bindAsUser} ${srcpath} /data/${name}" ExecStart = lib.mkForce ("!" + (lib.getExe startScript));
# #) cfg.bindPaths;
#ExecStopPost = lib.mapAttrsToList (
# name: _: "+${pkgs.util-linux}/bin/umount /data/${name}"
#) cfg.bindPaths;
}; };
}; };