nixos/tandoor-recipes: improve manage script

This is mirroring the way the manage script is created in the paperless
module, which is more robust to special characters.
This commit is contained in:
Bruno BELANYI 2024-02-11 21:21:00 +00:00
parent 61276c8099
commit 5e43c70867

View file

@ -17,14 +17,11 @@ let
lib.mapAttrs (_: toString) cfg.extraConfig
);
manage =
let
setupEnv = lib.concatStringsSep "\n" (mapAttrsToList (name: val: "export ${name}=\"${val}\"") env);
in
pkgs.writeShellScript "manage" ''
${setupEnv}
exec ${pkg}/bin/tandoor-recipes "$@"
'';
manage = pkgs.writeShellScript "manage" ''
set -o allexport # Export the following env vars
${lib.toShellVars env}
exec ${pkg}/bin/tandoor-recipes "$@"
'';
in
{
meta.maintainers = with maintainers; [ ambroisie ];