jkasdjkdaskas

This commit is contained in:
2025-04-08 03:10:06 +02:00
parent 5e370255c7
commit 506dec3a6b

View File

@@ -50,12 +50,34 @@ list-packages +$cut_args="-c1-": _packages_json
| grep -v $'\t'pkgs/tools/package-management/akku/default.nix \
| grep -v $'\t'pkgs/tools/typesetting/tex/texlive/build-texlive-package.nix
@_list_packages_attrpath_filtered:
xargs -d $'\n' -n 2000 just __list_packages_attrpath_filtered
__list_packages_attrpath_filtered +attrpaths:
#!/usr/bin/env -S bash -euo pipefail
declare -a attrpaths=("$@")
attrpaths=("${attrpaths[@]/"."/"\."}")
attrpaths=("${attrpaths[@]/"*"/"\*"}")
attrpaths=("${attrpaths[@]/"+"/"\+"}")
attrpaths=("${attrpaths[@]/"$"/"\$"}")
attrpaths=("${attrpaths[@]/"("/"\("}")
attrpaths=("${attrpaths[@]/")"/"\)"}")
attrpaths=("${attrpaths[@]/#/"^"}")
attrpaths=("${attrpaths[@]/%/$'\t'}")
# printf >&1 "'%s'\n" "${attrpaths[@]}"
just list-packages | grep "$(printf "%s\n" "${attrpaths[@]}")"
[no-cd]
@list-ripgrepped-packages +$ripgrep_args:
[[ -e .git && -e flake.nix ]] || { echo >&2 "ERROR; Not in repo root"; false; }
[[ -n "$ripgrep_args" ]] || { echo >&2 "ERROR; No ripgrep args"; false; }
[[ -e .git && -e flake.nix ]] || { echo >&2 "ERROR: Not in repo root"; false; }
[[ -n "$ripgrep_args" ]] || { echo >&2 "ERROR: No ripgrep args"; false; }
rg "$@" pkgs/ -tnix -l | just _list_packages_fname_filtered
[no-cd]
@list-nix-located-packages +$nix_locate_args:
[[ -e .git && -e flake.nix ]] || { echo >&2 "ERROR: Not in repo root"; false; }
[[ -n "$nix_locate_args" ]] || { echo >&2 "ERROR: No nix-locate args"; false; }
nix-locate --top-level --regex "$@" | cut -d' ' -f1 | sd '\.out$' '' | sort -u | just _list_packages_attrpath_filtered
@list-dirty-packages:
test -n "$($GIT diff HEAD --name-only)" || { echo >&2 "No unstaged dirty files found!"; false; }
cd "$invokedir"; $GIT diff HEAD --name-only | just _list_packages_fname_filtered
@@ -74,6 +96,10 @@ list-packages +$cut_args="-c1-": _packages_json
[[ -n "$extra_args" ]] && export _JUST_NIX_INSTANTIATE_ARGS="$(shift; shift; printf " %q" "$@")"; \
cd "$invokedir"; just list-ripgrepped-packages "$ripgrep_arg" | cut -f1 | xargs printf "${attr_prefix//%/%%}"'%s'"${attr_suffix//%/%%} " | xargs just build-packages
@build-nix-located-packages $nix_locate_arg $attr_prefix="" $attr_suffix="" +$extra_args="":
[[ -n "$extra_args" ]] && export _JUST_NIX_INSTANTIATE_ARGS="$(shift; shift; printf " %q" "$@")"; \
cd "$invokedir"; just list-nix-located-packages "$nix_locate_arg" | cut -f1 | xargs printf "${attr_prefix//%/%%}"'%s'"${attr_suffix//%/%%} " | xargs just build-packages
@build-dirty-packages $attr_prefix="" $attr_suffix="" +$extra_args="":
[[ -n "$extra_args" ]] && export _JUST_NIX_INSTANTIATE_ARGS="$(shift; shift; printf " %q" "$@")"; \
cd "$invokedir"; just list-dirty-packages | cut -f1 | xargs printf "${attr_prefix//%/%%}"'%s'"${attr_suffix//%/%%} " | xargs just build-packages