diff --git a/flake.nix b/flake.nix index 31fb387..a1211f7 100644 --- a/flake.nix +++ b/flake.nix @@ -37,11 +37,16 @@ # Normally we'd also run with `--option restrict-eval true`, but # this is incompatible with flakes because reasons. nur = pkgs.writeShellScriptBin "nur-check" '' + # Prefer nixpkgs channel (actual build), otherwise read from flake.lock (CI) + if ! nixpkgs=$(nix-instantiate --find-file nixpkgs 2>/dev/null); then + _rev=$(${pkgs.jq}/bin/jq -r .nodes.nixpkgs.locked.rev flake.lock) + nixpkgs="https://github.com/nixos/nixpkgs/archive/''${_rev}.tar.gz" + fi nix-env -f . -qa \* --meta \ --allowed-uris https://static.rust-lang.org \ --option allow-import-from-derivation true \ --drv-path --show-trace \ - -I nixpkgs=$(nix-instantiate --find-file nixpkgs) \ + -I nixpkgs="$nixpkgs" \ -I ./ \ --json | ${pkgs.jq}/bin/jq -r 'values | .[].name' '';