This repository contains the the configuration files for my NixOS machines.
This repository contains my configuration files for my Linux distribution of choice: NixOS. NixOS is special in the sense that it allows to configure all services, users, files, mounts, all via configuration files. Making the exact state of the system reproducible.
Here are some of the reasons you might want to use NixOS:
Nix builds packages in isolation from each other. This ensures that they are reproducible and don’t have undeclared dependencies, so if a package works on one machine, it will also work on another. Declarative
Nix makes it trivial to share development and build environments for your projects, regardless of what programming languages and tools you’re using.
Nix ensures that installing or upgrading one package cannot break other packages. It allows you to roll back to previous versions, and ensures that no package is in an inconsistent state during an upgrade.
This repository has 2 main directories:
- Systems: the systems that I've configured. Load modules from
modules/. You can learn more about the systems directory in the systems README. - Modules: is used to store a set of modules a
systemcan load. You can learn more about that in the modules README.
Here is an overview of the structure:
NixOS/
├── systems/
├── modules/
├── flake.nix
└── flake.lock
There is also the flake.nix, and flake.lock of course here at the root to make the systems completely reproducible.
The flow is as follows:
- The flake takes the argument from the CLI and loads the system from
./systems/somewhere. - That system loads the module loader at
/modules/default.nix, which you can read more about here. - The module loader loads the modules specified in the machines settings.
You can learn more about the structure of the systems directory, modules directory, or user directory by clicking these links.
These resources helped me with building my own configuration file:
| Name | Link | Explanation |
|---|---|---|
| NixOS Setup Guide - Configuration / Home-Manager / Flakes | YouTube | A good start/run down of how to make your NixOS config. |
| How to Start Adding Modularity to Your NixOS Config | YouTube | A guid to modularity. I recommend all his video's. |
| Nix Packages Manual | ryantm's GitHub Pages | Contains SO MANY useful library functions and their descriptions. |