test/nixos-search: fix running flake-info in an offline environment
This commit is contained in:
parent
3cc6010658
commit
5d0907b064
3 changed files with 30 additions and 4 deletions
|
|
@ -3,13 +3,19 @@ set -euo pipefail
|
|||
|
||||
cd "${BASH_SOURCE[0]%/*}"
|
||||
|
||||
nbFlake=$(realpath ../..)
|
||||
|
||||
# Use cachix to cache the `flake-info` build
|
||||
cachixCache=nix-bitcoin
|
||||
|
||||
nix run .#cachix -- use "$cachixCache"
|
||||
|
||||
# shellcheck disable=SC2016
|
||||
PATH=$(nix shell -L .#flake-info .#cachix -c sh -c 'echo $PATH')
|
||||
PATH=$(nix shell -L .#{flake-info,cachix,jq} -c sh -c 'echo $PATH')
|
||||
|
||||
# flake-info uses `nixpkgs` from NIX_PATH
|
||||
NIX_PATH="nixpkgs=$(nix flake metadata --json --inputs-from "$nbFlake" nixpkgs | jq -r .path)"
|
||||
export NIX_PATH
|
||||
|
||||
if [[ ${CACHIX_SIGNING_KEY:-} ]]; then
|
||||
cachix push "$cachixCache" "$(type -P flake-info)";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue