Conduit is a simple, fast and reliable chat server powered by Matrix https://conduit.rs
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
697 B
26 lines
697 B
#!/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 |
|
nix build "$@" |
|
|
|
if [ ! -z ${ATTIC_TOKEN+x} ]; then |
|
nix run --inputs-from . attic -- \ |
|
login \ |
|
conduit \ |
|
"${ATTIC_ENDPOINT:-https://attic.conduit.rs/conduit}" \ |
|
"$ATTIC_TOKEN" |
|
|
|
# Push the target installable and its build dependencies |
|
nix run --inputs-from . attic -- \ |
|
push \ |
|
conduit \ |
|
"$(nix path-info "$INSTALLABLE" --derivation)" \ |
|
"$(nix path-info "$INSTALLABLE")" |
|
else |
|
echo "\$ATTIC_TOKEN is unset, skipping uploading to the binary cache" |
|
fi
|
|
|