Based on Linux, NixOS is quite a unique distro! It allows for a almost complete control over the entire system with the use of a single configuration file (That get a bit too big, so you inevitably end up breaking it into parts, of course) and that brings a unique possibility: Recreating an entire OS with only a configuration file (And Internet access).
My NixOS configuration is my first take on Linux. Not a conventional way to get familiar with the ecosystem, but the idea it proposes was way too tempting! An entire OS, in the palm of my configured exactly how I want it to!
- Flakes: A way to declare the system's inputs and outputs. It allows my system to have many different repositories as inputs and many different hosts as outputs. Also, it pins the exact commit for each input, allowing for a precise recreation of the system, which is nice.
- Home-Manager, both as standalone and as a NixOS module: It allows for quick edits on dotfiles (
home-manager switch
) without recreating the system, but it also allows the newly recreated system (sudo nixos-rebuild switch
) to manage my home folder.- Plasma-Manager: A module which allows to declare many of the options of KDE Plasma.
- Stylix: Declares colors, themes, and wallpapers for a bunch of programs. Its perfect to theme the environment without unholy hours of work.
- Agenix: Stores secrets as encripted files, and decripts them at runtime. Nor Git or Nix knows the content, only NixOS does, when its running.
- My flake might be clean, but a lot of the mess is hidden within
configurationBuilder.nix
. - My entire configuration is basically divided between
./public-config
and./private-config
, which is a Git submodule. Privacy and all that.- The directory
./programs
inside contains all programs which require configuration. Its giant and messy. Its Perfect.- They are all automatically imported based on the file names.
- The directory
- Both
./hosts
and./users
contains a./default
configuration, and specific configuration for each one. - Anything inside
./modules
is made to be portable../modules/flake-modules
contains a lot of utilities that abstracts contents offlake.nix
.- Starting from
nixos-system.nix
, they can be strung together to "modify" a basic configuration into a more complete one. - For example,
home-manager-module.nix
can be used bynixos-system.nix
to generate a NixOS with Home-Manager module installed. - There is a bunch more.
- Starting from
./modules/nix-modules
are "simple" nix functions. Useful utilities and stuff../modules/nixos-modules
can be imported by a configuration. They add new options and functionalities.
- System upgrades uses this
nixos-config
(main
) repository, but all my development happens atnixos-config-dev
(develop
), which is a Git worktree.- Only working builds are merged into
main
. This avoids a surprise upgrade that uses an half-done configuration.
- Only working builds are merged into