2021-12-10 05:07:58 -08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
cd "${BASH_SOURCE[0]%/*}"
|
|
|
|
|
|
|
|
# Use cachix to cache the `flake-info` build
|
|
|
|
cachixCache=nix-bitcoin
|
|
|
|
|
2022-08-16 12:00:00 -07:00
|
|
|
nix run .#cachix -- use "$cachixCache"
|
2021-12-10 05:07:58 -08:00
|
|
|
|
|
|
|
# We're running in a basic, unprivileged container that doesn't support sandboxing.
|
|
|
|
# Sandboxing is unnneeded because we're only building the 3rd-party `flake-info` tool.
|
|
|
|
echo "sandbox = false" >> /etc/nix/nix.conf
|
2022-08-16 12:00:00 -07:00
|
|
|
|
|
|
|
# shellcheck disable=SC2016
|
|
|
|
PATH=$(nix shell -L .#flake-info .#cachix -c sh -c 'echo $PATH')
|
2021-12-10 05:07:58 -08:00
|
|
|
|
|
|
|
if [[ ${CACHIX_SIGNING_KEY:-} ]]; then
|
2022-08-16 12:00:00 -07:00
|
|
|
cachix push "$cachixCache" "$(type -P flake-info)";
|
2021-12-10 05:07:58 -08:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Running flake-info (nixos-search)"
|
2023-02-19 05:53:54 -08:00
|
|
|
flake-info --json flake ../.. >/dev/null
|