about summary refs log tree commit diff
path: root/nixos/modules/services/misc
diff options
context:
space:
mode:
authorBruno BELANYI <bruno@belanyi.fr>2024-02-11 21:21:00 +0000
committerBruno BELANYI <bruno@belanyi.fr>2024-02-11 21:21:02 +0000
commit5e43c708676c9ca0cb5d4c848ee9f3057e94b815 (patch)
tree8c900c53691a9ce2843e5893618362c2ac6e5290 /nixos/modules/services/misc
parent61276c8099fbfc6d6ab72b9b2794cf22e9c9db45 (diff)
downloadnixlib-5e43c708676c9ca0cb5d4c848ee9f3057e94b815.tar
nixlib-5e43c708676c9ca0cb5d4c848ee9f3057e94b815.tar.gz
nixlib-5e43c708676c9ca0cb5d4c848ee9f3057e94b815.tar.bz2
nixlib-5e43c708676c9ca0cb5d4c848ee9f3057e94b815.tar.lz
nixlib-5e43c708676c9ca0cb5d4c848ee9f3057e94b815.tar.xz
nixlib-5e43c708676c9ca0cb5d4c848ee9f3057e94b815.tar.zst
nixlib-5e43c708676c9ca0cb5d4c848ee9f3057e94b815.zip
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.
Diffstat (limited to 'nixos/modules/services/misc')
-rw-r--r--nixos/modules/services/misc/tandoor-recipes.nix13
1 files changed, 5 insertions, 8 deletions
diff --git a/nixos/modules/services/misc/tandoor-recipes.nix b/nixos/modules/services/misc/tandoor-recipes.nix
index 6c51a9bb8555..a8300ecd5233 100644
--- a/nixos/modules/services/misc/tandoor-recipes.nix
+++ b/nixos/modules/services/misc/tandoor-recipes.nix
@@ -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 ];