2
0
Fork 0

nix: use escapeShellArg for vars in wrapper scripts

This commit is contained in:
D Anzorge 2021-06-16 01:19:05 +02:00
parent 596f9aa8bb
commit 7d7127da1e

View file

@ -42,8 +42,8 @@ let
loadEnv = (pkgs.writeScript "load-bookwyrm-env" ''
#!/usr/bin/env bash
${lib.concatStringsSep "\n" (lib.mapAttrsToList (n: v: "export ${n}='${v}'") env)}
${lib.concatStringsSep "\n" (lib.mapAttrsToList (n: v: ''export ${n}="$(cat '${v}')"'') envSecrets)}
${lib.concatStringsSep "\n" (lib.mapAttrsToList (n: v: "export ${n}=${lib.escapeShellArg v}") env)}
${lib.concatStringsSep "\n" (lib.mapAttrsToList (n: v: ''export ${n}="$(cat ${lib.escapeShellArg v})"'') envSecrets)}
'');
bookwyrmManageScript = (pkgs.writeScriptBin "bookwyrm-manage" ''
#!/usr/bin/env bash