gitlab-runner: get nix ssh cache as pub key

This commit is contained in:
Leonardo Eugênio 2025-07-19 16:53:59 -03:00
parent 734a94fa8d
commit b3e0af1da6
No known key found for this signature in database
GPG key ID: 2F8F21CE8721456B
4 changed files with 15 additions and 6 deletions

View file

@ -1,7 +1,7 @@
#!/bin/sh
echo "nix-cache: Setting up ssh key and host" >&2
STORE_HOST_PUB_KEY="$(echo "$NIX_CACHE_SSH_PUBLIC_KEY" | base64 | tr -d '\n')"
STORE_HOST_PUB_KEY="$(cat "$NIX_CACHE_SSH_PUBLIC_KEY_PATH" | base64 | tr -d '\n')"
STORE_URL="ssh://nix-ssh@nix-cache.wopus.dev?trusted=true&compress=true&ssh-key=$NIX_CACHE_SSH_PRIVATE_KEY_PATH&base64-ssh-public-host-key=$STORE_HOST_PUB_KEY"
echo STORE_URL="$STORE_URL" >&2