diff --git a/scripts/cache-node.sh b/scripts/cache-node.sh index 38a2e6c..9b84a29 100644 --- a/scripts/cache-node.sh +++ b/scripts/cache-node.sh @@ -1,16 +1,21 @@ set -eu -o pipefail +drv=$("@colmena@/bin/colmena" eval --instantiate -E "{ nodes, ... }: nodes.${BUILD_NODE}.config.system.build.toplevel") + +# 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 + cat <.netrc default login $STORE_USER password $STORE_PASSWORD EOF -drv=$("@colmena@/bin/colmena" eval --instantiate -E "{ nodes, ... }: nodes.${BUILD_NODE}.config.system.build.toplevel") - -# Build the derivation and send it to the great beyond -nix-store --query --requisites --force-realise --include-outputs "$drv" | grep -v '.*\.drv' >paths.txt - nix copy \ --extra-experimental-features nix-command \ --to "$STORE_ENDPOINT?compression=none" \