quote: init
This commit is contained in:
parent
8b55369fa7
commit
a15736cbb0
13
krebs/5pkgs/simple/quote.nix
Normal file
13
krebs/5pkgs/simple/quote.nix
Normal file
@ -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
|
||||
''
|
13
shell.nix
13
shell.nix
@ -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
|
||||
]}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user