From 8bde30945460ace36293396fdc8ee8d584c05ba3 Mon Sep 17 00:00:00 2001 From: Bob van der Linden Date: Wed, 8 Mar 2023 16:59:45 +0100 Subject: [PATCH] use util-linuxMinimal instead of util-linux for column Currently the util-linux package is used for the column cli. This is the only dependency for which util-linux is used. It results in quite a significant addition to the closure size. util-linuxMinimal is somewhat smaller and also includes the column command. --- src/devenv.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/devenv.nix b/src/devenv.nix index c9280a755..dc86bd8d7 100644 --- a/src/devenv.nix +++ b/src/devenv.nix @@ -150,14 +150,14 @@ pkgs.writeScriptBin "devenv" '' if [ "$results" = "{}" ]; then echo "No packages found for '$name'." else - ${pkgs.jq}/bin/jq -r '[to_entries[] | {name: ("pkgs." + (.key | split(".") | del(.[0, 1]) | join("."))) } * (.value | { version, description})] | (.[0] |keys_unsorted | @tsv) , (["----", "-------", "-----------"] | @tsv), (.[] |map(.) |@tsv)' <<< "$results" | ${pkgs.util-linux}/bin/column -ts $'\t' + ${pkgs.jq}/bin/jq -r '[to_entries[] | {name: ("pkgs." + (.key | split(".") | del(.[0, 1]) | join("."))) } * (.value | { version, description})] | (.[0] |keys_unsorted | @tsv) , (["----", "-------", "-----------"] | @tsv), (.[] |map(.) |@tsv)' <<< "$results" | ${pkgs.util-linuxMinimal}/bin/column -ts $'\t' echo fi echo if [ "$results_options" = "{}" ]; then echo "No options found for '$name'." else - ${pkgs.jq}/bin/jq -r '["option","type","default", "description"], ["------", "----", "-------", "-----------"],(to_entries[] | [.key, .value.type, .value.default, .value.description[0:80]]) | @tsv' <<< "$results_options" | ${pkgs.util-linux}/bin/column -ts $'\t' + ${pkgs.jq}/bin/jq -r '["option","type","default", "description"], ["------", "----", "-------", "-----------"],(to_entries[] | [.key, .value.type, .value.default, .value.description[0:80]]) | @tsv' <<< "$results_options" | ${pkgs.util-linuxMinimal}/bin/column -ts $'\t' fi echo echo "Found $(${pkgs.jq}/bin/jq 'length' <<< "$results") packages and $(${pkgs.jq}/bin/jq 'length' <<< "$results_options") options for '$name'."