this post was submitted on 22 Dec 2025
6 points (100.0% liked)
Nix / NixOS
2583 readers
12 users here now
Main links
Videos
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
The way I solved this problem is that I write my
flake.nixin a literate-programming style using Org Roam. I have a code block that tangles out intoout/flake.nix, which has a<<flake-inputs>>placeholder. I can have any number of code blocks, in any number of Org files that all referenceflake-inputs. Thus, my inputs are near other code (& documentation) that uses them, split across dozens of files.The downside is that you no longer write Nix directly, but have to tangle it out.
first time im earing of Org Roam, but i think i kinda understand, do ya got a repo where i can see how u did it im kinda interested
Here's one for my infra, and my first attempt, for my desktop. The latter will eventually merge into the former.
o thanks, i'll take a closer look but for what i've seen so far it kinda looks complex I also flake-part mentioned in some of the commits,i remember seeing it a few times and apparently it can modularize flakes or sum like that, can it modularize inputs too outta curiosity
It's complex, because it does a lot of things, and it evolved over the past few years. The basics are very, very simple:
In some other file, you can then do:
And voila, you now have:
How you organize your org documents, is entirely up to you. The trick is that this lets you split it up as you see fit, and you are no longer restricted by what the language or any framework built on top of it can provide.
o yea now i see better how it works, all i gotta do is learn some emacs stuff and then i should be able to do it, thanks a lot!