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
|
|
@ -4,8 +4,24 @@
|
|||
{
|
||||
inputs.nixos-search.url = "github:nixos/nixos-search";
|
||||
|
||||
outputs = { self, nixos-search }: {
|
||||
inherit (nixos-search) packages;
|
||||
outputs = { self, nixos-search }: let
|
||||
systems = [
|
||||
"x86_64-linux"
|
||||
"aarch64-linux"
|
||||
];
|
||||
inherit (nixos-search.inputs.nixpkgs) lib;
|
||||
in {
|
||||
packages = lib.genAttrs systems (system: {
|
||||
# In flake-info, Rust calls into Nix code which uses `nixpkgs` from NIX_PATH.
|
||||
# Don't set `nixpkgs` to a tarball URL, use the default value from the environment instead.
|
||||
# This allows running flake-info in an offline environment (./flake-info-sandboxed.sh).
|
||||
flake-info = nixos-search.packages.${system}.flake-info.overrideAttrs (old: {
|
||||
postPatch = (old.postPatch or "") + ''
|
||||
substituteInPlace src/commands/nix_flake_attrs.rs --replace-fail \
|
||||
'command.add_arg_pair("-I", "nixpkgs=https://github.com/NixOS/nixpkgs/archive/refs/heads/nixpkgs-unstable.tar.gz");' ""
|
||||
'';
|
||||
});
|
||||
});
|
||||
|
||||
# Used by ./ci-test.sh
|
||||
inherit (nixos-search.inputs.nixpkgs) legacyPackages;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue