2024-11-14 22:01:58 +01:00
|
|
|
set -o errexit
|
|
|
|
set -o nounset
|
|
|
|
set -o pipefail
|
|
|
|
shopt -s lastpipe
|
2024-10-09 21:32:38 +02:00
|
|
|
|
2024-11-14 22:01:58 +01:00
|
|
|
drv=$(colmena eval --instantiate -E "{ nodes, ... }: nodes.${BUILD_NODE}.config.system.build.toplevel")
|
2024-10-11 14:53:00 +02:00
|
|
|
|
|
|
|
# Build the derivation and send it to the great beyond
|
|
|
|
nix-store --query --requisites --force-realise --include-outputs "$drv" | grep -v '.*\.drv' >paths.txt
|
|
|
|
|
|
|
|
if [ "$STORE_PASSWORD" == "" ]; then
|
|
|
|
echo "No password given for the remote cache, uploading cannot take place."
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2024-10-09 21:32:38 +02:00
|
|
|
cat <<EOF >.netrc
|
|
|
|
default
|
|
|
|
login $STORE_USER
|
|
|
|
password $STORE_PASSWORD
|
|
|
|
EOF
|
|
|
|
|
|
|
|
nix copy \
|
|
|
|
--extra-experimental-features nix-command \
|
|
|
|
--to "$STORE_ENDPOINT?compression=none" \
|
|
|
|
--netrc-file .netrc \
|
|
|
|
"$(nix-store --realise "$drv")"
|
|
|
|
|
|
|
|
rm .netrc
|