mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-16 15:21:24 +01:00
simplify attic call
The comment isn't really needed since the reasoning applies to the other instances of readarray and here-strings too, and the IFS bit is unnecessary.
This commit is contained in:
parent
85b9080c77
commit
7fc39b1845
1 changed files with 7 additions and 12 deletions
|
|
@ -15,11 +15,8 @@ just() {
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
nix run --inputs-from . attic -- \
|
nix run --inputs-from . attic#default -- \
|
||||||
login \
|
login "$ATTIC_SERVER" "$ATTIC_ENDPOINT" "$ATTIC_TOKEN"
|
||||||
"$ATTIC_SERVER" \
|
|
||||||
"$ATTIC_ENDPOINT" \
|
|
||||||
"$ATTIC_TOKEN"
|
|
||||||
|
|
||||||
# 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 "$@")
|
||||||
|
|
@ -29,15 +26,13 @@ just() {
|
||||||
<<< "${derivations[*]}"
|
<<< "${derivations[*]}"
|
||||||
)
|
)
|
||||||
|
|
||||||
# Upload them to Attic
|
# Upload them to Attic. It seems to insist on newlines to separate the
|
||||||
#
|
# paths.
|
||||||
# Use `xargs` and a here-string because something would probably explode if
|
|
||||||
# several thousand arguments got passed to a command at once. Hopefully no
|
|
||||||
# store paths include a newline in them.
|
|
||||||
(
|
(
|
||||||
IFS=$'\n'
|
IFS=$'\n'
|
||||||
nix shell --inputs-from . attic -c xargs \
|
nix run --inputs-from . attic#default -- \
|
||||||
attic push "$ATTIC_SERVER:$ATTIC_CACHE" <<< "${cache[*]}"
|
push --stdin --no-closure "$ATTIC_SERVER:$ATTIC_CACHE" \
|
||||||
|
<<< "${cache[*]}"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue