diff options
author | pacien | 2022-08-22 18:53:59 +0200 |
---|---|---|
committer | pacien | 2022-08-22 18:53:59 +0200 |
commit | 9f8ee57824aa587ecdb28620457ba53573249f3a (patch) | |
tree | c75ba2c78db141dcfb215f6b1c547c6c9306cf69 /lib | |
parent | 96411aaa21543c81ce53fd9210e63c5e3d4ac519 (diff) | |
download | flaky-utils-9f8ee57824aa587ecdb28620457ba53573249f3a.tar.gz |
lib.mkDevShell: escape environment variable values
Diffstat (limited to 'lib')
-rw-r--r-- | lib/mk-dev-shell.nix | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/mk-dev-shell.nix b/lib/mk-dev-shell.nix index e0bb441..8078f35 100644 --- a/lib/mk-dev-shell.nix +++ b/lib/mk-dev-shell.nix | |||
@@ -4,8 +4,10 @@ | |||
4 | }: | 4 | }: |
5 | 5 | ||
6 | let | 6 | let |
7 | # TODO: escape values properly | 7 | exportEnvVar = k: v: with pkgs.lib; '' |
8 | exportEnvVar = k: v: ''export ${k}="${v}"; echo ${k}=\"${v}\"''; | 8 | export ${escapeShellArg k}=${escapeShellArg v} |
9 | echo ${escapeShellArg k}=${escapeShellArg v} | ||
10 | ''; | ||
9 | exportedEnvVars = pkgs.lib.mapAttrsToList exportEnvVar envVars; | 11 | exportedEnvVars = pkgs.lib.mapAttrsToList exportEnvVar envVars; |
10 | 12 | ||
11 | in pkgs.mkShell { | 13 | in pkgs.mkShell { |