Skip to content

Commit 711e4f3

Browse files
committed
fixup svd: disallow double quotes in environment
1 parent 46f00cc commit 711e4f3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

modules/supervisord.nix

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ let
9494
autorestart = program.autoRestart;
9595
environment = let
9696
# FIXME: Make more robust
97-
escape = builtins.replaceStrings [ "%" ] [ "%%" ];
97+
escape = s:
98+
assert lib.assertMsg (!(lib.hasInfix "\"" s)) "supervisord.programs.<name>.environment: Values cannot have double quotes at the moment (${s})";
99+
builtins.replaceStrings [ "%" ] [ "%%" ] s;
98100
envs = lib.mapAttrsToList (k: v: "${k}=\"${escape v}\"") program.environment;
99101
in builtins.concatStringsSep "," envs;
100102
} // program.extraConfig;

0 commit comments

Comments
 (0)