this post was submitted on 22 Dec 2025
4 points (100.0% liked)

Nix / NixOS

2555 readers
1 users here now

Main links

Videos

founded 2 years ago
MODERATORS
 

I'm starting to have a lot of flake inputs in my flake.nix file, and it's starting to get really cluttered. I'm wondering if there's a way to separate my inputs into multiple files so it looks cleaner. I've tried to look it up but couldn't really find anything abt it

Edit: Well as it turns out it's not something possible yet, apparently the flake.nix file isn't parsed like regular nix files and doesn't support stuff like import

you are viewing a single comment's thread
view the rest of the comments
[โ€“] Klaymore@sh.itjust.works 2 points 1 day ago (1 children)

One note about // is that it doesn't deep combine attribute sets, so if you set the .url in one and .inputs.nixpkgs.follows in another then it will only use the second one. I don't think that matters here but it's tripped me up before. I think lib.mkMerge is the deep recursive alternative.

[โ€“] hallettj@leminal.space 2 points 1 day ago* (last edited 1 day ago)

Good point! But I think lib.mkMerge only merges options in a module system like the ones used in NixOS, Home Manager, and flake-parts configs. In this situation I think the function to use would be lib.attrsets.recursiveUpdate