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-03-06 03:21:35 +00:00
|
|
|
nix build -L "$@"
|
2024-01-26 04:39:59 +00:00
|
|
|
|
2024-03-02 15:59:27 +00:00
|
|
|
if [ ! -z "$ATTIC_TOKEN" ]; then
|
2024-03-06 02:42:17 +00:00
|
|
|
nix run --inputs-from . attic -- \
|
|
|
|
login \
|
|
|
|
conduit \
|
|
|
|
"${ATTIC_ENDPOINT:-https://attic.kennel.juneis.dog/conduit}" \
|
2024-01-26 04:39:59 +00:00
|
|
|
"$ATTIC_TOKEN"
|
|
|
|
|
2024-03-06 02:42:17 +00:00
|
|
|
# Push the target installable and its build dependencies
|
|
|
|
nix run --inputs-from . attic -- \
|
|
|
|
push \
|
|
|
|
conduit \
|
|
|
|
"$(nix path-info "$INSTALLABLE" --derivation)" \
|
2024-01-26 04:39:59 +00:00
|
|
|
"$(nix path-info "$INSTALLABLE")"
|
|
|
|
|
2024-02-14 21:33:41 +00:00
|
|
|
|
|
|
|
# push to "conduwuit" too
|
2024-03-06 02:42:17 +00:00
|
|
|
nix run --inputs-from . attic -- \
|
|
|
|
login \
|
|
|
|
conduwuit \
|
|
|
|
"${ATTIC_ENDPOINT:-https://attic.kennel.juneis.dog/conduwuit}" \
|
2024-02-14 21:33:41 +00:00
|
|
|
"$ATTIC_TOKEN"
|
|
|
|
|
2024-03-06 02:42:17 +00:00
|
|
|
# Push the target installable and its build dependencies
|
|
|
|
nix run --inputs-from . attic -- \
|
|
|
|
push \
|
|
|
|
conduwuit \
|
|
|
|
"$(nix path-info "$INSTALLABLE" --derivation)" \
|
2024-02-14 21:33:41 +00:00
|
|
|
"$(nix path-info "$INSTALLABLE")"
|
2024-01-26 04:39:59 +00:00
|
|
|
else
|
|
|
|
echo "\$ATTIC_TOKEN is unset, skipping uploading to the binary cache"
|
|
|
|
fi
|