-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nix: flakes: allow overriding flake inputs in bulk with extra nix file #4193
Comments
Some parts of this functionality are already available via the primary/flake.nix:
override/flake.nix:
As far as I can tell,
It would be useful if Adding a new flag is another option, but it might increase confusion over which of the many override flags should be used in which situation, as there already exist three of them:
It would on the other hand complete the set of flags for overriding registry entries and flake inputs via other flakes and single arguments. |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/to-flake-or-not-to-flake/10047/4 |
I marked this as stale due to inactivity. → More info |
This would be useful to me as well. |
another option, make another flake: and do something like this: {
inputs = {
"tow-boot-rpi" = { url = "path:/home/cole/code/tow-boot/rpi"; };
"tow-boot-visionfive" = { url = "path:/home/cole/code/tow-boot/visionfive"; };
"super" = {
url = "path:../../";
inputs."tow-boot-rpi".follows = "tow-boot-rpi";
inputs."tow-boot-visionfive".follows = "tow-boot-visionfive";
};
};
outputs = { ... }@inputs: inputs.super;
} but then you still have to make sure to re-generate the lock file as needed, and it also winds up in some silly things happening - every single changes results in getting updated, and you have to re-create lock still, and it sort of duplicates all inputs that you are overriding. |
@colemickens Thanks for sharing this suggestion— I'm implementing something similar right now as an enabler for offline flake use, where One issue with it I've hit is that |
I made a little tool to help me deal with this issue. I have only tested it with my use cases and for those it seems to work correctly. Guess I should share it in case it can help someone else out. @colemickens It is very close to what you wished for, my approach just requires adding your target flake as part of the inputs and have it be the output. For example add |
Is your feature request related to a problem? Please describe.
Using
--override-inputs
forces an update to the lock file, which makes it harder for me to do "test with all of my own local overrides". (this is issue #3779)Also, I have a few projects that are dependent on a number of other in-development flake repos. It's a bit much to have to carry around this list of flags:
Describe the solution you'd like
Instead, maybe both of these problems could be addressed with the addition of an optional override file (conventionally named flake-overrides.nix, and normally assumed to be
.gitignore
d.)flake-overrides.nix
:used with:
nix build --flake-overrides flake-overrides.nix '.#hosts.slynux'
Assumptions:
flake.nix
, but only theinputs
attribute is allowed--flake-overrides
, theflake.lock
is not updatedIdeas:
--impure-overrides ./flake-overrides.nix
--impure
should be required)Describe alternatives you've considered
n/a
Additional context
n/a
The text was updated successfully, but these errors were encountered: