get-flake icon indicating copy to clipboard operation
get-flake copied to clipboard

Overriding inputs

Open roberth opened this issue 1 year ago • 2 comments

We have all the info we need in order to override inputs.

I don't know if implementing that would be an ambition of this project, diverging more from flake-compat, but it is feasible to do so.

One possible use case for this, is to split development dependencies in a separate lock file, but when loading those inputs, always override Nixpkgs to be the main Nixpkgs from the main lock file. Ultimately that is a workaround for https://github.com/NixOS/nix/issues/7730 which aims to make inputs lazier so that we don't have to care about splitting those, but that issue will take time to implement.

roberth avatar Aug 30 '24 10:08 roberth

I would say it's in the scope of this project. What is the API you're envisioning?

ursi avatar Aug 31 '24 17:08 ursi

This could be a new function besides __functor that takes an extra argument representing overrides, similar to what you'd get with --override-input on flakes that are loaded into the Nix CLI. The syntax for this new argument could be reminiscent of flake.nix inputs, and it could contain either sources or already evaluated flakes (ie like a getFlake return value, where outputs has been called, etc).

roberth avatar Sep 01 '24 17:09 roberth