2024-01-26 04:39:59 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
# The first argument must be the desired installable
|
|
|
|
INSTALLABLE="$1"
|
|
|
|
|
|
|
|
# Build the installable and forward any other arguments too
|
2024-01-28 16:46:01 +00:00
|
|
|
nix build -L "$@"
|
2024-01-26 04:39:59 +00:00
|
|
|
|
|
|
|
if [ ! -z ${ATTIC_TOKEN+x} ]; then
|
|
|
|
|
|
|
|
nix run --inputs-from . attic -- login \
|
|
|
|
conduit \
|
2024-01-27 21:41:27 +00:00
|
|
|
https://attic.kennel.girlcock.ceo/conduit \
|
2024-01-26 04:39:59 +00:00
|
|
|
"$ATTIC_TOKEN"
|
|
|
|
|
|
|
|
push_args=(
|
|
|
|
# Attic and its build dependencies
|
|
|
|
"$(nix path-info --inputs-from . attic)"
|
|
|
|
"$(nix path-info --inputs-from . attic --derivation)"
|
|
|
|
|
|
|
|
# The target installable and its build dependencies
|
|
|
|
"$(nix path-info "$INSTALLABLE" --derivation)"
|
|
|
|
"$(nix path-info "$INSTALLABLE")"
|
|
|
|
)
|
|
|
|
|
|
|
|
nix run --inputs-from . attic -- push conduit "${push_args[@]}"
|
|
|
|
else
|
|
|
|
echo "\$ATTIC_TOKEN is unset, skipping uploading to the binary cache"
|
|
|
|
fi
|