Wimpy's NixOS, nix-darwin & Home Manager Configurations โ๏ธ
MIT License
Made with ๐ for &
This repository contains a Nix Flake for configuring my computers and/or their home environment. It is not intended to be a drop in configuration for your computer, but you are welcome to use it as a reference or starting point for your own configuration. If you are looking for a more generic NixOS configuration, I highly recommend nix-starter-configs. ๐๏ธ These computers are managed by this Nix flake โ๏ธ
Hostname | Board | CPU | RAM | Primary GPU | Secondary GPU | Role | OS | State |
---|---|---|---|---|---|---|---|---|
vader |
MEG-X570-UNIFY | AMD Ryzen 9 5950X | 128GB | Fighter RX 7900 GRE | RTX 2000E Ada Generation | ๐ฅ๏ธ | โ๏ธ | โ |
phasma |
MEG-X570-ACE | AMD Ryzen 9 5900X | 128GB | Fighter RX 7900 GRE | RTX 2000E Ada Generation | ๐ฅ๏ธ | โ๏ธ | โ |
sidious |
ThinkPad P1 Gen 1 | Intel Xeon E-2176M | 64GB | NVIDIA Quadro P2000 Max-Q | Intel UHD Graphics P630 | ๐ป๏ธ๐ญ๏ธ | โ๏ธ | โ |
palpatine |
โคด๏ธ | โคด๏ธ | โคด๏ธ | โคด๏ธ | โคด๏ธ | ๐ป๏ธ๐ญ๏ธ | ๐ช | โ |
tanis |
ThinkPad Z13 Gen 1 | AMD Ryzen 5 PRO 6650U | 32GB | AMD Radeon 660M | ๐ป๏ธ | โ๏ธ | โ | |
shaa |
ThinkPad T14s Gen 1 | AMD Ryzen 5 PRO 4650U | 16GB | AMD Radeon RX Vega 6 | ๐ป๏ธ | โ๏ธ | โ | |
momin |
Macbook Air M2 15" | Apple M2 8-core CPU | 24GB | Apple M2 10-core GPU | ๐ป๏ธ | ๐ | โ | |
krall |
Macbook Pro (Mid 2015) | Intel Core i7 | 16GB | Intel Iris Pro Graphics | ๐ป๏ธ | ๐ | โ | |
steamdeck |
Steam Deck 64GB LCD | Zen 2 4c/8t | 16GB | 8 RDNA 2 CUs | ๐ฎ๏ธ | ๐ง | โ | |
crawler |
QEMU | - | - | VirGL | ๐ | โ๏ธ | โ | |
dagger |
QEMU | - | - | VirGL | ๐ | โ๏ธ | โ | |
defender |
Lima | - | - | - | ๐ | ๐ง | โ | |
fighter |
Lima | - | - | - | ๐ | ๐ง | โ | |
revan |
Z390-DESIGNARE | Intel Core i9-9900K | 64GB | Intel UHD Graphics 630 | NVIDIA T1000 | โ๏ธ | โ๏ธ | ๐ง |
Workstation and server host names are Sith Lords and the virtual machines are named after TIE fighter series. Dual boot systems have the NixOS install named a Sith Lord and the "other" OS named after their public-facing persona.
Key
As featured on Linux Matters podcast! ๐๏ธ I am a presenter on Linux Matters and this configuration was featured in Episode 7 - Immutable Desktop Linux for Anyone.
The nixos/_mixins and home-manager/_mixins are a collection of composited configurations based on the arguments defined in flake.nix.
build-iso console
or build-iso <desktop>
(see below)install-system <hostname> <username>
from a terminal
disks.sh
to automatically partition and format the disks, then uses my flake via nixos-install
to complete a full-system installation~/Zero/nix-config
nixos-enter
command is used to automatically chroot into the new system and apply the Home Manager configuration.I clone this repo to ~/Zero/nix-config
. NixOS and Home Manager changes are applied separately because I have some non-NixOS hosts.
gh repo clone wimpysworld/nix-config ~/Zero/nix-config
build-host
and switch-host
aliases are provided that build the NixOS configuration and switch to it respectively.build-home
and switch-home
aliases are provided that build the Home Manager configuration and switch to it respectively.build-all
and switch-all
aliases that build and switch to both the NixOS and Home Manager configurations.The build-iso
script is included that creates .iso images from this flake. The following modes are available:
build-iso console
(terminal environment): Includes install-system
for automated installation.build-iso gnome
(GNOME Desktop environment): Includes install-system
and Calamares installation.build-iso mate
(MATE Desktop environment): Includes install-system
and Calamares installation.build-iso pantheon
(Pantheon Desktop environment): Includes install-system
and Calamares installation.Live images will be left in ~/$HOME/Zero/nix-config/result/iso/
and are also injected into ~/Quickemu/nixos-console
and ~/Quickemu/nixos-<desktop>
respectively.
The console .iso image is also periodically built and published via GitHub Actions and is available in this project's Releases.
Nix is configured with flake support and the unified CLI enabled.
Here's the directory structure I'm using:
.
โโโ darwin
โ โโโ _mixins
โ โ โโโ desktop
โ โ โโโ scripts
โ โ โโโ users
โ โโโ momin
โ โโโ krall
โ โโโ default.nix
โโโ home-manager
โ โโโ _mixins
โ โ โโโ configs
โ โ โโโ desktop
โ โ โโโ features
โ โ โโโ scripts
โ โ โโโ services
โ โ โโโ users
โ โโโ default.nix
โโโ lib
โ โโโ default.nix
โโโ nixos
โ โโโ _mixins
โ โ โโโ configs
โ โ โโโ desktop
โ โ โโโ features
โ โ โโโ scripts
โ โ โโโ services
โ โ โโโ users
โ โโโ iso-console
โ โโโ iso-gnome -> iso-console
โ โโโ iso-mate -> iso-console
โ โโโ iso-pantheon -> iso-console
โ โโโ crawler -> dagger
โ โโโ phasma
โ โโโ revan
โ โโโ dagger
โ โโโ sidious
โ โโโ tanis
โ โโโ vader
โ โโโ default.nix
โโโ overlays
โ โโโ default.nix
โโโ pkgs
โ โโโ default.nix
โโโ secrets
โ โโโ secrets.yaml
โโโ flake.nix
nixos
, darwin
and home-manager
directories respectively, they are structured in a similar way with _mixins
directories that contain the configurations applied via mixin pattern that compose the final configuration.lib
directory contains helper functions for the nixos
, nix-darwin
and home-manager
configurations.overlays
directory hold my custom overlays.pkgs
directory contains my custom local packages.secrets
directory contains secrets managed by sops-nix.default.nix
files in the root of each directory are the entry points.Fish shell ๐๏ธ with powerline-go and a collection of tools that deliver a "Modern Unix" experience. The base system has a firewall enabled and also includes OpenSSH, sops-nix for secret management, Tailscale, Distrobox and, of course, a delightfully configured micro. (Fight me! ๐ฅ) My own scripts are (slowly) being migrated to NixOS scripts or Home Manager scripts to provide declarative, reproducible and shellcheck
validated tooling ๐งฐ
GNOME ๐ฃ MATE ๐ง and Pantheon ๐๏ธ desktop options are available. The font configuration is common for all desktops using Work Sans and Fira Code. The usual creature comforts you'd expect to find in a Linux Desktop are integrated such as Pipewire, Bluetooth, Avahi, CUPS, SANE and NetworkManager.
Desktops | NixOS | Home Manager | Theme |
---|---|---|---|
GNOME | GNOME NixOS | GNOME Home Manager | Catppuccin Mocha |
Hyprland | Hyprland NixOS | Hyprland Home Manager | Catppuccin Mocha |
MATE | MATE NixOS | MATE Home Manager | Catppuccin Mocha |
Pantheon | Pantheon NixOS | Pantheon Home Manager | Catppuccin Mocha |
Things I currently need to do manually after installation.
~/.config/sops/age/keys.txt
. Optionally handled by install-system
.ssh-to-age -i /etc/ssh/ssh_host_ed25519_key.pub
to .sops.yaml
.sops updatekeys secrets/secrets.yaml
gpg-restore
determinate-nixd login
sudo tailscale up
keybase login
atuin login -u <user>
maestral_qt
install-homebrew
.create-defender
create-fighter
incus admin init --minimal
create-defender
create-fighter
Some applications require manual configuration to apply the correct theme.
/* mocha */
@import url("https://catppuccin.github.io/discord/dist/catppuccin-mocha.theme.css");
@import url("https://catppuccin.github.io/discord/dist/catppuccin-mocha-blue.theme.css");
One of my laptops (sidious
) is a multi-disk system with Windows 11 Pro ๐ช installed on a separate disk from NixOS.
The Windows EFI partition is not automatically detected by systemd-boot, because it is on a different disk.
The following steps are required to copy the Windows Boot Manager to the NixOS EFI partition so dual-booting is possible.
Find Windows EFI Partition
lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT
Mount Windows EFI Partition
sudo mkdir /mnt/win-efi
sudo mount /dev/nvme1n1p1 /mnt/win-efi
Copy Contents of Windows EFI to NixOS EFI
sudo rsync -av /mnt/win-efi/EFI/Microsoft/ /boot/EFI/Microsoft/
Clean up
sudo umount /mnt/win-efi
sudo rm -rf /mnt/win-efi
Reboot and systemd-boot should now offer the option to boot NixOS and Windows.
Before preparing my NixOS and Home Manager configurations I took a look at what other Nix users are doing. My colleagues shared their configs and tips which included nome from Luc Perkins, nixos-config from Cole Helbling, flake from Ana Hoverbear and her Declarative GNOME configuration with NixOS blog post. A couple of friends also shared their configurations and here's Jon Seager's nixos-config and Aaron Honeycutt's nix-configs.
While learning Nix I watched some talks/interviews with Matthew Croughan and Will Taylor's Nix tutorials on Youtube. Will Taylor's dotfiles are worth a look, as are his videos, and Matthew Croughan's nixcfg is also a useful reference. After I created my initial flake I found nix-starter-configs by Gabriel Fontes which is an excellent starting point. I'll have since incorporated many of the techniques it demonstrates in my nix-config. Similarly, some of my nix-darwin configuration is inspired by nix-darwin-kickstarter.
I like the directory hierarchy in Jon Seager's nixos-config and the mixin pattern used in Matthew Croughan's nixcfg, so my initial Nix configuration is heavily influenced by both of those. Ana's excellent Declarative GNOME configuration with NixOS blog post was essential to get a personalised desktop. That said, there's plenty to learn from browsing other people's Nix configurations, not least for discovering cool software. I recommend a search of GitHub nixos configuration from time to time to see what interesting techniques you pick up and new tools you might discover.
The Disko implementation and automated installation are chasing the ideas outlined in these blog posts: