2021-12-10 16:07:58 +03: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 22:00:00 +03:00
|
|
|
nix run .#cachix -- use "$cachixCache"
|
2021-12-10 16:07:58 +03: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 22:00:00 +03:00
|
|
|
|
|
|
|
# shellcheck disable=SC2016
|
|
|
|
PATH=$(nix shell -L .#flake-info .#cachix -c sh -c 'echo $PATH')
|
2021-12-10 16:07:58 +03:00
|
|
|
|
|
|
|
if [[ ${CACHIX_SIGNING_KEY:-} ]]; then
|
2022-08-16 22:00:00 +03:00
|
|
|
cachix push "$cachixCache" "$(type -P flake-info)";
|
2021-12-10 16:07:58 +03:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Running flake-info (nixos-search)"
|
2023-02-19 16:53:54 +03:00
|
|
|
flake-info --json flake ../.. >/dev/null
|