improve variable names' clarity

This commit is contained in:
Charles Hall 2025-07-30 09:56:56 -07:00
parent 47c210d5de
commit 132528b545

View file

@ -12,7 +12,7 @@ just() {
# Find all output paths of the installables and their build dependencies # Find all output paths of the installables and their build dependencies
readarray -t derivations < <(nix path-info --derivation "$@") readarray -t derivations < <(nix path-info --derivation "$@")
readarray -t cache < <( readarray -t upload_paths < <(
xargs \ xargs \
nix-store --query --requisites --include-outputs \ nix-store --query --requisites --include-outputs \
<<< "${derivations[*]}" <<< "${derivations[*]}"
@ -32,13 +32,13 @@ just() {
IFS=$'\n' IFS=$'\n'
nix run --inputs-from . attic#default -- \ nix run --inputs-from . attic#default -- \
push --stdin --no-closure "$ATTIC_SERVER:$ATTIC_CACHE" \ push --stdin --no-closure "$ATTIC_SERVER:$ATTIC_CACHE" \
<<< "${cache[*]}" <<< "${upload_paths[*]}"
) )
} }
# Build and cache things needed for CI # Build and cache things needed for CI
ci() { ci() {
cache=( installables=(
--inputs-from . --inputs-from .
# Keep sorted # Keep sorted
@ -49,19 +49,19 @@ ci() {
nixpkgs#nix-direnv nixpkgs#nix-direnv
) )
just "${cache[@]}" just "${installables[@]}"
} }
# Build and cache all the package outputs # Build and cache all the package outputs
packages() { packages() {
readarray -t cache < <( readarray -t installables < <(
nix flake show --json 2> /dev/null | nix flake show --json 2> /dev/null |
nix run --inputs-from . nixpkgs#jq -- \ nix run --inputs-from . nixpkgs#jq -- \
-r \ -r \
'.packages."x86_64-linux" | keys | map(".#" + .) | .[]' '.packages."x86_64-linux" | keys | map(".#" + .) | .[]'
) )
just "${cache[@]}" just "${installables[@]}"
} }
pushd "$(git rev-parse --show-toplevel)" > /dev/null pushd "$(git rev-parse --show-toplevel)" > /dev/null