Allow externally overriding flake inputs #82

Open
opened 2025-07-10 15:56:00 +00:00 by molly · 0 comments
Member

I would like to be able to override the inputs in flakes which are imported using flake-compat.

As a motivating example: I import https://github.com/cachix/nixpkgs-python into my (non-flake) Nix profile at work using (the nix-community fork of) flake-compat, as I need a Python 3.7 interpreter for interacting with some appliances, and this version is no longer in Nixpkgs. The nixpkgs-python flake has a pin of nixpkgs in its inputs, so importing this flake will cause a copy of this pinned nixpkgs version to be copied into the store and evaluated. I would like to be able to override the input in the nixpkgs-python flake to use the copy of nixpkgs which I use for building the rest of my configuration to cut down on the eval time and copies of nixpkgs in my local Nix store.

For comparison, if my Nix profile were using flakes then I would be able to override the nixpkgs input in the nixpkgs-python flake using inputs.follows, but as far as I can tell equivalent functionality doesn't yet exist in flake-compat.

Prior art exists here in the form of this unmerged PR on the nix-community fork of flake-compat, and using the HEAD from the PR branch in my configuration has been working correctly for me.

I would like to be able to override the inputs in flakes which are imported using flake-compat. As a motivating example: I import https://github.com/cachix/nixpkgs-python into my (non-flake) Nix profile at work using (the nix-community fork of) flake-compat, as I need a Python 3.7 interpreter for interacting with some appliances, and this version is no longer in Nixpkgs. The nixpkgs-python flake has a pin of nixpkgs in its inputs, so importing this flake will cause a copy of this pinned nixpkgs version to be copied into the store and evaluated. I would like to be able to override the input in the nixpkgs-python flake to use the copy of nixpkgs which I use for building the rest of my configuration to cut down on the eval time and copies of nixpkgs in my local Nix store. For comparison, if my Nix profile were using flakes then I would be able to override the nixpkgs input in the nixpkgs-python flake using `inputs.follows`, but as far as I can tell equivalent functionality doesn't yet exist in flake-compat. Prior art exists here in the form of [this unmerged PR](https://github.com/nix-community/flake-compat/pull/4) on the nix-community fork of flake-compat, and using the HEAD from the PR branch in my configuration has been working correctly for me.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lix-project/flake-compat#82
No description provided.