diff options
-rw-r--r-- | krebs/5pkgs/simple/quote.nix | 13 | ||||
-rw-r--r-- | shell.nix | 13 |
2 files changed, 14 insertions, 12 deletions
diff --git a/krebs/5pkgs/simple/quote.nix b/krebs/5pkgs/simple/quote.nix new file mode 100644 index 000000000..7731e14bf --- /dev/null +++ b/krebs/5pkgs/simple/quote.nix @@ -0,0 +1,13 @@ +{ jq, writeDashBin }: + +# usage: quote [ARGS...] +writeDashBin "quote" '' + set -efu + prefix= + for x; do + y=$(${jq}/bin/jq -nr --arg x "$x" '$x | @sh "\(.)"') + echo -n "$prefix$y" + prefix=' ' + done + echo +'' @@ -143,18 +143,6 @@ let ''} ''); - # usage: quote [ARGS...] - cmds.quote = pkgs.writeDash "cmds.quote" '' - set -efu - prefix= - for x; do - y=$(${pkgs.jq}/bin/jq -nr --arg x "$x" '$x | @sh "\(.)"') - echo -n "$prefix$y" - prefix=' ' - done - echo - ''; - init.env = pkgs.writeText "init.env" /* sh */ '' export quiet export system @@ -243,6 +231,7 @@ in pkgs.stdenv.mkDerivation { fi export PATH=${lib.makeBinPath [ pkgs.populate + pkgs.quote shell.cmdspkg ]} |