-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Labels
Description
Describe the bug
I used to be able to specify in a flake nixpkgs.url = "flake:nixpkgs"; to mean that I should follow the system registry nixpkgs. This was really practical for small local projects, or when deploying a flake to multiple machines where the PATH to a flake differs between machines.
Sadly it seems like this is buggy now. This actually tries to fetch the latest version on github instead of using my local version.
Steps To Reproduce
Create flake.nix with
{
description = "A very basic flake";
inputs = {
flake-parts.url = "github:hercules-ci/flake-parts";
nixpkgs.url = "github:nixos/nixpkgs/c97c47f2bac4fa59e2cbdeba289686ae615f8ed4";
};
outputs = { flake-parts, ... } @ inputs: flake-parts.lib.mkFlake { inherit inputs; } {
perSystem = { config, self', inputs', pkgs, system, ... }: {
devShells.default = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
nodejs_22
playwright-driver.browsers
];
shellHook = ''
export PLAYWRIGHT_BROWSERS_PATH=${pkgs.playwright-driver.browsers}
export PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS=true;
export PLAYWRIGHT_NODEJS_PATH=${pkgs.nodejs_22}/bin/node
playwright_chromium_revision="$(${pkgs.jq}/bin/jq --raw-output '.browsers[] | select(.name == "chromium").revision' ${pkgs.playwright-driver}/browsers.json)"
export PLAYWRIGHT_LAUNCH_OPTIONS_EXECUTABLE_PATH=${pkgs.playwright-driver.browsers}/chromium-$playwright_chromium_revision/chrome-linux/chrome
echo "Using $PLAYWRIGHT_LAUNCH_OPTIONS_EXECUTABLE_PATH"
'';
};
};
# Declared systems that your flake supports. These will be enumerated in perSystem
systems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
};
}
and run nix develop
Expected behavior
It should use my machine nixpkgs version while I see it trying to download a very recent version.
Metadata
❯ nix-env --version
nix-env (Nix) 2.31.2
Additional context
See also discussion in https://discourse.nixos.org/t/flake-does-not-follow-local-nixpkgs-anymore-even-with-flake-nixpkgs/76052
Checklist
- checked latest Nix manual (source)
- checked open bug issues and pull requests for possible duplicates
Add 👍 to issues you find important.
Reactions are currently unavailable