startScript

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

View File

@ -9,25 +9,24 @@
let
cfg = config.mj.services.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
#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}
# '';
#};
{
options.mj.services.immich = with lib.types; {
enable = lib.mkEnableOption "enable immich";
@ -59,7 +58,7 @@ in
# testing
PrivateMounts = lib.mkForce false;
ExecStart = lib.mkForce ("!" + (lib.getExe startScript));
#ExecStart = lib.mkForce ("!" + (lib.getExe startScript));
};
};