From 9f8ee57824aa587ecdb28620457ba53573249f3a Mon Sep 17 00:00:00 2001 From: pacien Date: Mon, 22 Aug 2022 18:53:59 +0200 Subject: lib.mkDevShell: escape environment variable values --- lib/mk-dev-shell.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib') 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 @@ }: let - # TODO: escape values properly - exportEnvVar = k: v: ''export ${k}="${v}"; echo ${k}=\"${v}\"''; + exportEnvVar = k: v: with pkgs.lib; '' + export ${escapeShellArg k}=${escapeShellArg v} + echo ${escapeShellArg k}=${escapeShellArg v} + ''; exportedEnvVars = pkgs.lib.mapAttrsToList exportEnvVar envVars; in pkgs.mkShell { -- cgit v1.2.3