Modularize your NixOS modules using the dendritic approach

https://pc-hass.de/blog/modularize-your-nix-modules/

Currently in the process of writing this, but I felt like the current progress already has some stuff worth sharing. I'd be happy for some feedback and possible improvements!

19 points · 6 comments · view on lemmy.world

6 Comments

rozodru@piefed.world · 2 pts · 202d (5 replies)

I recently changed my nixos configs to this approach. Takes a bit to remember where I put everything and what modules things are in but in the long term it makes things easier to manage. Also makes things easier if I need to turn modules on or off for whatever reason.

That being said does take a bit of work to get everything set up but in the long run it's worth it.

Laser@feddit.org · 2 pts · 202d (4 replies)

What do you mean? Dendritic approach or having modules in a separate flake? Or both?

rozodru@piefed.world · 2 pts · 201d (3 replies)

going the Dendtritic Approach.

Laser@feddit.org · 1 pts · 201d (2 replies)

It's certainly very helpful with that, I can say I learned quite a bit about nix, but also about flake-parts during the migration and I'd say the latter is criminally underrated in the community.

rozodru@piefed.world · 3 pts · 201d (1 reply)

the thing with NixOS is there's really no right or wrong way to configure your system. I know a guy that just straight up has a single configuration file and then just uses comma for everything. like practically nothing is installed. when he uses firefox its ", firefox" in a terminal. he likes it.

ruffsl@programming.dev · 1 pts · 195d

I love the comma command. Great for things I only use every blue moon and am fine with being cleaned up by garbage collection.