this post was submitted on 24 Jul 2024
15 points (100.0% liked)

Nix / NixOS

1831 readers
1 users here now

Main links

Videos

founded 2 years ago
MODERATORS
 

I am just setting up my NixOS config for the first time, and I know that it will be fairly complex. I know it will only be possible and scalable if I have sane conventions.

I have read a number of example configs, but there does not seem to be consistent conventions between them of where to store custom option declarations, how to handle enabling/disabling modules, etc. They all work, but they do it in different ways.

Are there any official or unofficial conventions/style guides to NixOS config structure, and where can I find them?

For example, should I make a lib directory where I put modules that are easily portable and reusable in other people's configs? When should I break modules up into smaller ones? Etc. These are things that I hope to be addressed.

you are viewing a single comment's thread
view the rest of the comments
[–] kueckieben@discuss.tchncs.de 2 points 5 months ago

There are no established conventions yet, you can do as you please. There are some frameworks trying to create structures, but they are in no way mandatory or even agreed upon.