This NixOS configuration is almost exactly what I use on my own systems.
It is a single-user setup with the Niri Wayland compositor as its base environment. It uses NixOS unstable under the hood, with some help from Home Manager.
It is a successor to my old NixOS configuration, which is now archived.
When using this configuration, make sure to read and modify each module of interest to you. It is, after all, made for myself first. It is assumed that you have prior experience with NixOS (without flakes), or you will be lost.
To make the experience as painless as possible, the entire /etc/nixos/
dierctory and all of its files have user read and write access, without the need for a password. If this is a security concern for you, considering disabling this in the ./uncategorized/nix-settings.nix
module.
This configuration splits hardware modules into two:
- The automatically-generated hardware configuration file in the
./hardware/generated/
directory, renamed to fit the device that is targeted. - The manually-written hardware configuration file in the
./hardware/devices/
directory, renamed to fit the device that is targeted.
The automatically-generated hardware configuration files are untouched from the ones created by running nixos-generate-config --root /path/to/system
.
The manually-written hardware configuration files contains settings such as, but not limited to:
- Kernel version
- If the system boots in EFI or BIOS mode
- Hostname
- Optional network modules
- Workarounds for specific hardware/firmware bugs
- Default keyboard layout with priority over the
./input/keyboard-layout.nix
module - Firmware update manager with fwupd
Naturally, you can see the already-present files to see what you should configure yourself.
In the ./user/name.nix
module, you must set your user's name and title (description). They will be automatically be applied to all the modules that need them, using ${config.userName}
and ${config.userTitle}
.
To see which modules use these variables, open a console where this configuration is located, and run the following command: grep -Rn "\${config.user"
-R
reads all files under each directory, recursively, also following any symbolic links.
-n
shows the relevant line number at the end of the file names.
To enable support for NVIDIA GPUs (16XX+ 20XX+) with the relevant proprietary drivers, you can uncomment the ./nvidia.nix
import in the configuration.nix
module. In here, you will also find literally every module that can be commented in/out for your needs.
- Single user.
- Personal computing.
- Desktop and laptops.
- Accessibility.
- Touchscreen.
- Remote desktop.
- Computers with:
- A non-x86_64 (AMD64) CPU architecture.
- Hybrid GPU setup (NVIDIA PRIME, etc).
- Less than 2GiB of RAM (swap WILL be heavily used with less than 6 when building the system).
- Less than 48GiB of storage (some Nix storage optimizations are already enabled).
Help is available in:
- The configuration.nix(5) man page.
- The on-device manual by running the
nixos-help
command. - The online manual
- The NixOS Wiki
- The Nix.dev documentation for the Nix ecosystem.
A searchable list of available packages for NixOS can be found here:
NixOS package search
A searchable list of available options for NixOS can be found here:
NixOS options search
A (slow) list of available options for Home Manager can be found here:
Home Manager search
The beautiful wallpaper in the screenshot is made by t1na.