nixos-config/docs/content/en/02-lay-of-the-land/02-project-structure/index.adoc

2.0 KiB
Raw Blame History


title: Project structure --- = Project structure

Next, we have the project directory — the environment youll be living in for the next year, tinkering your Nix configs. It is required to be familiar with the workspace, after all. My configuration takes a lot of cues from devos (which is unfortunately is a lot to take if youre just beginning to grok Nix as a whole).

My NixOS config should look like the following:

nixos-config
├── configs/
├── docs/
├── lib/
├── modules/
├── overlays/
├── pkgs/
├── shells/
├── templates/
├── default.nix
├── flake.lock
├── flake.nix
└── README.adoc
  • ./docs/ contain the source code for the website. Currently, it uses Hugo for statically generating the website.

  • ./configs/ contain several configurations for several environments including NixOS, home-manager, and flake-parts. Typically, these are anything that are configured by Nix modules.

  • ./modules/ contain my custom modules including NixOS and home-manager modules. For more information, see the github:{github-repo}[related documentation, path=./modules/README.adoc, rev=master].

  • ./overlays/ contain the overlays for several established packages. This is typically used exclusively for the project and advised to not use it if youre not foodogsquared.

  • ./pkgs/ contains my custom packages. It is exported in the flakes at outputs.packages compiled through various systems.

  • ./shells/ contains my development shells for interacting with the usual type of projects. Setting this up can bring benefits outside of NixOS (unless youre interacting with projects with any OpenGL-related stuff). [1]

  • ./templates/ contains my custom templates handy for quickly initializing for various types of projects.


1. Since packages brought from Nix shells can only work with the store, a container might be better at some situations.