I've been using NixOS since 22 June 2024. This is the config I run on all my systems. It has gone through many, many iterations and has come to be a passion project of mine; I am sure it will continue to be iterated upon, improved, and expanded. I have learned much from it and I look forward to continuing to learn from it.
My nixconf is structured specifically to be logical and help me work with it. Here's a basic rundown:
flake.nix
Nix Flake: The entry-point of my system.flake
Flake modules: The parts of my flake that make up the whole, powered by flake-parts.hosts/
System specific configuration: Mainlyhardware-configuration.nix
and specific option selection, especially defining the profiles.configuration.nix
Host-specific configuration & module selectionhardware-configuration.nix
Auto-generated per-host
modules/
Modular system configuration: The bulk of my system configurationcommon
Modules that are generally made available to all my hosts.desktop
Desktop modules: Primarily Hyprland currently.options
Module Options: Configures what modules are disabled or enabled per system and per profileprofiles
Profile modules: Special programs, services, and configuration needed on each profile.
secrets
Agenix Secrets Management
- Each profile has its own options for enabling and disabling apps and installing programs.
- Each host can select which profiles' modules to import.
- The profile itself can be enabled or disabled, and this sets the default option of its programs to be enabled or disabled by default.
Credit to @NotAShelf for inspiration and references.
Home Manager is a lovely tool for many people that helps manage their dotfiles for them. I used it myself for the first 6 months of my journey on NixOS. I then decided it was best to move away from it. With @NotAShelf and @éclairevoyant's Hjem, I successfully migrated from Home Manager and began managing my dotfiles myself.
Home Manager has a few problems for me, in increasing severity:
- Abstracts too much;
- Lengthens eval times; and
- Requires a differentiation between HM modules and Nix modules.
In the past, I structured my nixconf to account for the differentiation between the two module types, but it caused me inconveniences that I would rather have gone without.
If you wish to do the same, I would consider this config to be a decent jumping-off point. You may also want to keep an eye on my currently WIP Hjem Rum, a module collection for hjem, offering options similar to Home Manager. This solves the latter two issues while not neglecting the fact that for many, the first issue is not a bug but a feature.
For a while, I tried to document and explain any quirky choices I made in my config. But at this point, I'm past my limit, and I'm adding more insanity to it by the week. If you have any questions for how or why I did something a certain way, you can feel free to reach out to me.
Name | Description | Profiles | Type |
---|---|---|---|
polaris |
Primary daily-driver: the first system I installed NixOS on. | Gaming, Workstation | Desktop |
procyon |
Framework 13 laptop with a Ryzen 7040. | Workstation | Laptop |
No project is done alone. This is especially so in the FOSS World. I would like to credit and thank the following people for sharing their configuration, wisdom, or knowledge:
@0atman, whose NixOS video first got me interested in the space.
@vimjoyer, for his videos, and for his public nixconf, which I learned and referenced for my own configuration which shares its namesake.
@NotAShelf, for enough reasons that I am certain to leave something out. For his now archived Nix config, for the extensive help and patience he has given me, and for being insane enough to do a lot that I have learned from. Much of my config is heavily inspired by his.
@PolarFill, for collaborating with me on Hjem Rum and providing me with his thoughts.
Many other members from SNUG, who have collaborated with me on projects like Hjem Rum and also allowed me to engage with community to further pursue Nix.
@viperML, especially for his blogposts from which I learned to write mkDerivations, but also for his projects like nh.
@itslychee, for help on Discord.
This list will be sure to grow, and I have probably missed people. So to everyone else I have interacted with on my Nix journey, thank you.
Unless explicitly stated otherwise, all code within this repo is protected under GPLv3. If you use any of my code please give me credit with a comment and optionally in the README.