startScript

This commit is contained in:
Motiejus Jakštys 2024-09-29 19:49:47 +03:00
parent 75a7281dce
commit bc527c096d
1 changed files with 18 additions and 19 deletions

View File

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