This repo contains the dotfiles for my NixOS config.
If you want to try it out you need to create a new host and potentially a new user account and then run just switch
If you want to setup a Windows dualboot you need to set Windows to use UTC time instead of local time
This configuration is constantly in development and may also not reflect the current state of my config.
Feel free to take elements and inspiration from this config in order to create your own
There are two config directories for each user in a system.
They have a set of options that are only applied when using home manager and a set of options that are applied when using NixOS and home manager
The home manager specific configuration is in ./users/${user}/default.nix
and the shared system config is in ./hosts/${host}/default.nix
Those options are not evaluated by the usual home manager or nix modules system,
instead they are evaluated ahead of time.
This means that that config's settings can be used to get the stateVersion
(and potentially the system architecture in the future)
Modules for NixOS and home manager as well as shared modules are stored in the modules
folder (under the nix
, home
and common
folders respectively)
The options for the aforementioned system config are stored in the options
directory and are recursively gathered.
The options that they generate are documented below
The NixOS and home manager configs also gather a few specific files for their config so that if you need to specify configuration that is unique to that computer or user then you can do so.
These files are:
- Home manager:
./users/${user}/home.nix
./hosts/${host}/home.nix
- NixOS:
./hosts/${host}/configuration.nix
./hosts/${host}/hardware-configuration.nix
Modules in system specific files cannot affect the main system options and the config for the options can't control the systems directly
The overall structure of the system is as follows:
(Modules with ! aren't optional, modules with _ are home manager specific and modules with - are NixOS specific)
dotfiles
| hosts
| ⌞ ${host}
| | _home.nix
| | !default.nix
| | -configuration.nix
| ⌞ -hardware-configuration.nix
| modules
| | common
| | ⌞ *
| | nix
| | ⌞ -*
| ⌞ home
| ⌞ _*
| options
| ⌞ *
⌞ users
⌞ ${user}
| default.nix
⌞ _home.nix
Hostname | Environment | Use case | State | Device description |
---|---|---|---|---|
Hydra | NixOS | Linux learning device | ⛔ | Old silver laptop |
Amphisbaena | NixOS Dualboot | Main work device | ✅ | Thin black laptop |
Minotaur | WSL on Amphisbaena | Linux features on windows | ⛔ | ^ |
Cerberus | NixOS VM on Amphisbaena | Using Linux more often | ⛔ | ^ |
Chimaera | NixOS Dualboot | Gaming and streaming | 🚧 | Large white desktop |
✅ yes
⛔ no
🚧 in progress
- Individual configs for different machines by customizing data in the hosts folder
- Update home manager and NixOS together or separately
- Templates for various project types in resources/templates
stateVersion
= a string that is used for the stateVersionbatteryManagement.enable
= enable battery managementcoding.enable
= enable generic code editorsenvironment
hyprland.enable
= enable hyprlandgnome.enable
= enable gnomeKDE.enable
= enable KDE
fun.enable
= enable fun tools like fastfetchgamedev.enable
= enable game development toolsgaming.enable
= enable gamesgrub
enable
= enable grubuseEfi
= enable grub EFI supportwindowsLocation
= uuid of windows partition
GUI.enable
= enable GUI packagesWSL.enable
= enable WSL supportVM.enable
= enable vm supportusers.${user}
enable
= enable this useradmin
= give this user admin permissions
When using a wsl config like minotaur
it may occasionally throw an error along the lines of
Failed to mount /lib/modules/5.15.146.1-microsoft-standard-WSL2.
.
This is because you have updated your WSL version without changing the mount path of the wsl config.
To fix this go to the hardware-configuration for the system and change the line that has that mount path to respect your current WSL version.
(You can get your WSL version with WSL --version
, the line you're looking for is "Kernel version")
A few of the configs that I've taken ideas from include:
(A more up to date and comprehensive list of what I've looked at)
No doubt I've missed a few from when I was first getting into nix but I am thankful to everyone who left their config on the internet for me to learn from.