Skip to content

Repository files navigation

Screenshot of my desktop running this NixOS configuration Wallpaper by Mikael Gustafsson.


Monthly changelog (DD/MM/YYYY)

19/09/2026

  • Computer settings are now more modular and located in a more sensible place.
  • Micro's included files are shorter.
  • configuration.nix has gained some comments.
  • Other minor changes for modularity and cleanliness.
  • Removed (build failure) comments on packages that, in fact, do build properly. I was still using an old manual tagging system when packages failed back then, and had forgotten to remove them.
  • The shared config.user.name string is now checked for characters and length. I hope I did that correctly.
  • Updated the README's screenshot.

  • The computers (hosts) are now automatically selected by their networking.hostName name when rebuilding the system. The hostname and the file path where the device's /etc/nixos/computers/<your-pc>/settings.nix resides in must match.
    For example, the hostname of my Ryzen 7-based computer is r7-pc, and its settings.nix module resides in /etc/nixos/computers/r7-pc/settings.nix.
    You can treat it like a flake's --host option, except without flakes, and automatic.

17/09/2026

  • Overhauled the MiDiPLUS SmartPAD macropad script.
  • Since said script now starts as a systemd service, its startup command in Niri has been removed.
  • Updated some Noctalia settings.

12/09/2026

  • Right-clicking on the power button now shows power profile options when available.

10/09/2026

  • Overhauled the power actions in Noctalia.

09/09/2026

  • Power actions are no longer enabled by default without a prefix in the program launcher (accidental reboots begone).
  • Added corefonts and vista-fonts for additional compatibility when reading and editing documents from Windows computers.

05/09/2026

  • Transitionned from Noctalia Shell 4.X to Noctalia 5.X, as it is now considered stable. This is an upgrade in certain ways, downgrades in others, but it is snappier and lighterweight across the board. There may be some minor missing configurations; They will be added here gradually when discovered.
  • Fixed duplicate pkgs.lib.getBin in ./programs/system-info.nix.
  • Btop has higher privileges to have access to more hardware sensors without the need to run it with run0.
  • Switched from GDM to the Noctalia Greeter.
  • Theming now has its own config module to more easily share theming configuration across modules.
  • Switched to the Zen Kernel, left the option for the latest too just in case.
  • Other little changes here and there.

Atemo's NixOS configuration

GIF of Ralsei from DELTARUNE doing a cute pirouette.

An opinionated NixOS configuration that does not piss me off


Main components

Package and configuration base

This configuration is entirely NixOS, more specifically, based on the nixos-unstable-small channel. It makes no use of Nix Flakes, Home Manager, or Flatpaks. I have nothing against them, I simply find the idea of a "pure" NixOS configuration rather attractive. This may make some things harder or not possible, but it is (so far) fine with me.

Display Manager

The Display Manager is the Noctalia Greeter. It replaces GDM, and feels like a more natural and logical choice here.

Wayland compositor

Niri is the Wayland compositor used. It supports more hardware than Hyprland does (which is what I used to use), runs faster on my systems, and the scrollable-tilling model is too good to live without.
https://github.com/YaLTeR/niri

I also use the Oniri program, to automatically maximize a window when it is the only one present on a workspace.
https://github.com/Antiz96/oniri

Desktop shell

Noctalia Shell is the desktop shell. It has done an excellent job at replacing every little other components, scripts, and programs I used to use to replicate a fraction of its functionalities.
https://github.com/noctalia-dev/noctalia-shell

Installation

Usage disclaimer

This entire desktop experience is crafted by and for myself only. It will likely not fit most other people's needs and desires. However, you may feel free to take inspiration from this configuration; I have uploaded it publicly for this reason as well.

With this out of the way, we can now proceed to the installation instructions. These are the steps I take to install this NixOS configuration onto my devices; They may not be exactly what you want out of such a configuration, so, feel free to adapt them to your needs.

Assumptions

It is assumed, for these installations instructions, that you:

  • Are familiar with Linux
  • Are familiar with NixOS, or have at least used it once
  • Are comfortable working within the command-line
  • Are currently using a Linux distribution
  • Have a stable power source and networking
  • Have your device's firmware set up to boot and install NixOS properly
  • Have read and acknowledge untested hardware and use-cases at the bottom of this README

Creating a bootable NixOS medium.

Downloading NixOS

Since this configuration is based on NixOS unstable (small), it is highly recommended to download the latest NixOS unstable ISO image.

I use my own graphical ISO; It is not ready for public use yet, but I might upload it here if it ever becomes ready.

Writing the ISO file

The NixOS ISO is too big to fit on a CD or smaller. As such, a DVD or any removable and bootable storage medium with above 4 GB of storage space is necessary. I will be using a USB flash drive here and the instructions will assume as much, and it is also assumed that the current environment is already Linux-based.

To stay as dependency-free as possible, I will use dd to flash the downloaded ISO file to the flash drive, but you may use any other utility. Graphically, I like Fedora's Media Writer, or Linux Mint's mintstick utility.

First, we need to identify which drive we want to write the ISO file onto. We can do so with lsblk:

NAME                    MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
sda                       8:112  1  28,7G  0 disk
└─sda1                    8:113  1  28,7G  0 part
zram0                   253:0    0  31,3G  0 disk  [SWAP]
nvme0n1                 259:0    0 931,5G  0 disk
├─nvme0n1p1             259:1    0     1G  0 part  /boot
├─nvme0n1p2             259:2    0    10G  0 part
│ └─swap                254:0    0    10G  0 crypt [SWAP]
└─nvme0n1p3             259:3    0 920,5G  0 part
  └─root                254:1    0 920,5G  0 crypt /home
                                                   /nix/store
                                                   /nix
                                                   /

Here, sda is the ~30 GB USB flash drive I want to use. All data on it will be erased once the ISO writing process begins.

We can now write the ISO file to the USB flash drive, with the following command with superuser privileges:

dd bs=4M if=latest-nixos-graphical-x86_64-linux.iso of=/dev/sda conv=fsync oflag=direct status=progress

Notes:

  • Replace latest-nixos-graphical-x86_64-linux.iso with the appropriate path and file name
  • Replace /dev/sda with the appropriate device to write the ISO file to

Booting

Insert the installation medium into the target computer, and start it. If your computer does not automatically boot to the installation medium, or do not know which key to press to open the boot menu, refer to your BIOS' settings and your motherboard manufacturer's documentation.
Once you have booted, make sure to configure your keyboard layout and networking if necessary. The default NixOS ISO lets you configure the key map in the TTY with the loadkeys command as a privileged user, and you can connect to a network using nmtui. Graphical environments come with their own utilities for this.

Partitioning

In my installation, I typically use an encrypted, single-drive setup, on an EFI system. You can easily adapt the following steps for a multi-drive setup and a BIOS-only system, though I will not document BIOS installations here until I can install NixOS on a BIOS-only system that is not as slow as my ThinkPad L510…
As before, command-line utilities will be used for maximum compatibility and minimum dependencies, but a lot of these steps can be done using graphical tools.

  1. Enter a shell as root with sudo -i.
  2. List the current storage devices with lsblk, and identify the one you want to use.
    In the case of this example, I will select /dev/sda, which is an empty 1 TB hard disk drive. Obviously, any data on it will be lost in the next few steps.
NAME                    MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
sda                       8:0    0 931,6G  0 disk
sdb                       8:112  1  28,7G  0 disk
└─sdb1                    8:113  1  28,7G  0 part
  1. Open the desired storage device with fdisk.
fdisk /dev/sda

You should see an output similar to this:

Welcome to fdisk (util-linux <version>).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Command (m for help):

Boot partition

  1. Create a GPT partition table by typing g then pressing Enter.
  2. Create a boot partition by typing n.
  3. When asked about the partition number, type 1 then press Enter.
  4. When asked about the first sector, it should be left unchanged, simply press Enter.
  5. When asked about the last sector, type +1G then press Enter. Note that you can change this size to be smaller or bigger, depending on the number of Linux Kernels you plan on keeping, especially if you keep lots of NixOS generations around.
    If the drive was not empty at first, fdisk will warn you before continuing. Type y then press Enter.
  6. Set the type of the boot partition by typing t then press Enter.
  7. When asked about the partition type, type 1 then press Enter.

Swap partition

  1. Create a swap partition by typing n.
  2. When asked about the partition number, it should be 2.
  3. When asked about the first sector, it should be left unchanged.
  4. When asked about the last sector, type +8G then press Enter. Note that you can change this size to be smaller or bigger, depending on if you want to be able to hibernate your system, and other things.
    If the drive was not empty at first, fdisk will warn you before continuing. Type y then press Enter.
  5. Set the type of the swap partition by typing t then press Enter.
  6. When asked about the partition type, type 19 then press Enter.

Root partition

  1. Create a root partition by typing n.
  2. When asked about the first and the last sector, they should be left unchanged. If the drive was not empty at first, fdisk will warn you before continuing. Type y then press Enter.

Verifying the changes

Until you execute a write, no changes are made to the disk, and you can safely exit at any time, so do not worry if you made mistakes. But to verify if you indeed did things properly, you can type p then press Enter to see what the final result will look like.
If something is off, you can type q then press Enter, and restart the process from step 3.

Writing the changes

If everything is looking good, you can write the changes to disk (this WILL erase all data on it) by typing w then pressing Enter.

Formatting and mounting

I use LUKS disk encryption. If you do not, you may skip the relevant encryption steps and adapt the steps for your setup.

Configuring LUKS

  1. Set up LUKS encryption for the swap partition.
cryptsetup --verify-passphrase luksFormat --label swap /dev/sda2

Replace sda2 with the swap partition you previously created. 2. Set up LUKS encryption for the root partition. You may use the same password as the swap partition for convenience and faster boot.

cryptsetup --verify-passphrase luksFormat --label root /dev/sda3

Replace sda3 with the root partition you previously created. 3. (Optional) Create backup headers to store somewhere safe. This is useful in case they ever get corrupted, somehow. Keep them in a safe, external storage device after creating them.

cryptsetup luksHeaderBackup /dev/sda2 -header-backup-file luks-header-backup-swap.bin
cryptsetup luksHeaderBackup /dev/sda3 -header-backup-file luks-header-backup-root.bin
  1. Open the encrypted partitions. If you use an SSD, add the --allow-discards command-line argument after cryptsetup open.
cryptsetup open /dev/sda2 swap
cryptsetup open /dev/sda3 root

Formatting the partitions and volumes.

  1. Format the swap volume.
mkswap -L Swap /dev/mapper/swap
  1. Format the storage volume. I use Btrfs, but you may use whichever filesystem makes you feel superior. If you do not use Btrfs, skip or change the steps related to Btrfs subvolumes and options.
mkfs.btrfs -L Storage /dev/mapper/root
  1. Format the boot partition.
mkfs.fat -F 32 -n BOOT /dev/sda1

Replace sda1 with the boot partition you previously created.

Mounting and activating filesystems

  1. Turn the swap on.
swapon /dev/mapper/swap
  1. Mount the root volume.
mount -v -t btrfs /dev/mapper/root /mnt
  1. Create the Btrfs subvolumes. Here, they will be @ (root), @home, and @nix.
btrfs subvolume create /mnt/@
btrfs subvolume create /mnt/@home
btrfs subvolume create /mnt/@nix
  1. Unmount the root volume.
umount -v /mnt
  1. Mount the root volume with the proper Btrfs subvolume. Additionally, I enable zstd compression.
mount -v -o subvol=@,compress=zstd:3 /dev/mapper/root /mnt
  1. Create the mount points for the boot, home, and nix volumes.
mkdir -v /mnt/boot
mkdir -v /mnt/home
mkdir -v /mnt/nix
  1. Mount the home and nix Btrfs subvolumes. Additionally, I enable zstd compression, and enable noatime for the nix subvolume to avoid unnecessary writes.
mount -v -o subvol=@home,compress=zstd:3 /dev/mapper/root /mnt/home
mount -v -o subvol=@nix,compress=zstd:3,noatime /dev/mapper/root /mnt/nix
  1. Mount the boot partition.
mount -v -o umask=077 /dev/sda1 /mnt/boot

NixOS configuration and installation

Now that the storage device is set up, we can now set up the NixOS configuration and install the final system.

Creating and configuring the NixOS configuration

  1. Generate the default NixOS configuration and automatically-generated hardware configuration file.
nixos-generate-config --root /mnt
  1. Temporarily move the hardware configuration file
rsync -ah --progress /mnt/etc/nixos/hardware-configuration.nix ~/
  1. Remove the default configuration.nix module, since it will not be used.
rm -v /mnt/etc/nixos/configuration.nix
  1. Clone this repository to /mnt/etc/nixos/.
git clone https://github.com/Atemo-C/NixOS-configuration /mnt/etc/nixos/
  1. Move the hardware configuration file to /mnt/etc/nixos/computers/your-comutper-name. Replace your-computer-name with the name of your computer.
mkdir -v /mnt/etc/nixos/computers/your-computer-name
rsync -ah --progress ~/hardware-configuration.nix /mnt/etc/nixos/computers/your-computer-name/
  1. Get the UUID of your swap partition. We will write it to /mnt/etc/nixos/computers/your-computer-name/settings.nix; It will be at the bottom of the module.
blkid /dev/sda2 >> /mnt/etc/nixos/computers/your-computer-name/settings.nix

The root partition should be configured automatically, which is why only the step for the swap partition remains. However, you might want to also do this with the root partition, if you want to set up additional options, such as discarding for SSDs. 7. Open this module with your preferred text editor. In this live environment, you can install the text editor of your choice with nix-env -iA nixos.your-text-editor-here.

your-editor-here /mnt/etc/nixos/computers/your-computer-name/settings.nix
  1. In it, the UUIDs for the encrypted swap partition is located on the bottom of the file. We need to add them to boot.initrd.luks.devices since NixOS does not automatically add it, and set up other settings, such as:
  • Discard for SSDs using boot.initrd.luks.devices.<name>.allowDiscards = true;;
  • Your computer's host name;
  • The keyboard layout configuration;
  • Filesystem-specific options (Btrfs compression, etc);
  • Import modules that you may want to use on certain devices but not others (e.g. host virtualization, gaming, etc);
  • Any other device-specific configuration that you may want. In this example, I will be configuring my main computer. If you need any help or inspiration, please have a look at the existing hardware configuration files in this repository, to see how certain things are done.
{ ... }: {
	imports = [
		# The main system configuration.
		# Not importing it results in, well, no system.
		../../configuration.nix

		# The automatically-generated hardware configuration file.
		# Not importing it results in, again, no system.
		./hardware-configuration.nix

		# Display configuration.
		./display.nix

		# Input devices and keyboard layout.
		./input.nix

		# Storage configuration.
		./storage.nix

		# GPU configuration and utilities.
		./gpu.nix

		# Virtualisation software.
		../../virtualisation/virt-manager.nix
	];

	# Whether the installation process is allowed to modify EFI boot variables.
	# Once installed and working, if after an update, it fails to "install" again,
	# it should be safe to turn this option off, even if it is not ideal.
	# We love firmware bugs.
	boot.loader.efi.canTouchEfiVariables = true;

	# Name of the computer over the network.
	# For this NixOS configuration, it must be lower-case.
	networking.hostName = "r7-pc";

	nix.settings = {
		# Limit the amount of cores used when building NixOS.
		# This is done to give some responsiveness and RAM back,
		# allowing the use of the system relatively normally when building.
		cores = 14;

		# Limit the number of maximum jobs running when building NixOS.
		# This is mostly so that the output is neater, and I like to see
		# programs compile one by one cleanly as well.
		# Not optimal for faster rebuilds.
		max-jobs = 1;
	};

	# Whether to enable fwupd, a DBus service allowing applications to update firmware.
	services.fwupd.enable = true;

	# Whether to enable Modem Mangaer, to handle cellular data.
	systemd.services.ModemManager.enable = false;
}

As you can see, the device's settings.nix module can also import other modules. This modularity allows for cleaner and more reusable parts across the systems, and more personalisations without having a single huge settings.nix file.

  1. Add the following lines to your configuration.nix in the imports list, making sure other devices are commented out with #:
	./computers/your-computer-name/hardware-configuration.nix
	./computers/your-computer-name/settings.nix
  1. Modify the rest of the NixOS configuration to fit your needs. This includes things such as:
  • The user's name and title;
  • Enabling proprietary drivers for Turing and above NVIDIA GPUs;
  • Localization settings, spell checking, timezone;
  • Various other settings, programs, etc.

Installing NixOS

  1. Read all the following steps carefully before running the commands! Install NixOS with the following command. You can add the --no-root-password option if you wish to not be able to log into the root account directly.
nixos-install -I nixos-config=/etc/nixos/computers/<your-computer>/settings.nix
  • Replace your-computer with the computer name you have selected.
  • Make sure your device's networking.hostName is the same as the name of the directory your computer's settings.nix resides in.
  1. Once NixOS is installed, set your user's password.
nixos-enter --root /mnt
passwd your-user-here
exit
  1. You can now safely power off the system, remove the installation medium, and boot into the full NixOS installation.

Use cases and feature implementation

Targeted use-case

  • Single user;
  • Personal computing;
  • x86_64 desktop and laptops;
  • The default user shell is the FISH shell;
  • This entire configuration is for me, it may not work well for you.

Not yet implemented or thoroughly tested, including but not limited to:

  • Accessibility features
  • Touchscreen support
  • Remote desktop through RDP or other
  • Computers with:
    • A non-x86_64 CPU architecture (not tested)
    • Hybrid GPU setup (e.g. NVIDIA PRIME) (not tested)
    • NVIDIA GPUs (I no longer have an NVIDIA GPU to test things with, so what is in this configuration is a best-effort attempt at making things work)
    • Less than 4 GIB of RAM (Swap may be heavily used with less than 8 when building the system, or doing other Nix things… If you have very little RAM, I hope on your soul that you at least have a capable SSD to let the swapping happen; Otherwise, may Xenia the Linux Fox have mercy on your soul)
    • Less than 64 GIB of storage (some Nix storage optimizations are already enabled).

Some useful NixOS resources

Help is available in:

A searchable list of available packages can be found here:
https://search.nixos.org/packages?channel=unstable

A searchable list of available options can be found here:
https://search.nixos.org/options?channel=unstable

About

An actively maintained, «pure» NixOS configuration; Using Niri and Noctalia for a full desktop. No Flakes, no Home Manager, no Flatpaks.

Topics

Resources

Stars

10 stars

Watchers

1 watching

Forks

Contributors

Languages