Wimpy's NixOS & Home Manager Configurations
This repository contains a Nix Flake for configuring my computers and home environment. These are the computers this configuration currently manages:
Hostname | OEM | Model | OS | Role | Status |
---|---|---|---|---|---|
designare |
DIY | i9-9900K | NixOS | Desktop | Done |
noname |
DIY | AMD 5900X, 6900 XT | NixOS | Gamestation | Done |
node202 |
DIY | AMD 5700G, 6700 XT | ChimeraOS | Gamestation | Done |
vm |
VM | - | NixOS | Desktop | Done |
ripper |
DIY | AMD 3970X | NixOS | Desktop | Done |
nuc |
Intel | NUC5i7RYH | NixOS | Server | WIP |
skull |
Intel | NUC6i7KYK | NixOS | Server | Done |
brix |
Gigabyte | GB-BXCEH-2955 | NixOS | Server | WIP |
trooper |
DIY | AMD 5950X, 3080Ti | NixOS | Desktop | Done |
zed |
Lenovo | ThinkPad Z13 Gen 1 | NixOS | Laptop | Done |
p1 |
Lenovo | ThinkPad P1 Gen 1 | NixOS | Laptop | Done |
pi4 |
Raspberry Pi | Raspberry Pi 4 | Ubuntu MATE | Desktop | tbn |
pinebook |
Pine64 | Pinebook | - | Laptop | tbn |
pinebook-pro |
Pine64 | Pinebook Pro | - | Laptop | tbn |
c630 |
Lenovo | Yoga C630 | Windows 10S | Laptop | tbn |
pocket |
GPD | Ubuntu MATE | Laptop | tbn | |
pocket2 |
GPD | Pocket 2 | Ubuntu MATE | Laptop | tbn |
pocket3 |
GPD | Pocket 3 | Ubuntu MATE | Laptop | tbn |
p2-max |
GPD | P2 Max | NixOS | Laptop | Done |
micropc |
GPD | Micro PC | NixOS | Laptop | WIP |
win2 |
GPD | WIN 2 | NixOS | Laptop | WIP |
win-max |
GPD | WIN Max | NixOS | Laptop | WIP |
falcon |
TopJoy | Falcon | Ubuntu MATE | Laptop | tbn |
macbookpro |
Apple | Macbook Pro 2015 | macOS | Laptop | tbn |
xps-13 |
Dell | XPS 13 9360 | Ubuntu MATE | Laptop | tbn |
spectre |
HP | Spectre 13 | Ubuntu MATE | Laptop | tbn |
apollo |
Entroware | Apollo 2000 | Ubuntu MATE | Laptop | tbn |
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.
- .github: GitHub CI/CD workflows Nix ❄️ supercharged ⚡️ by Determinate Systems
- home-manager: Home Manager configurations
- Sane defaults for shell and desktop
- nixos: NixOS configurations
- Includes discrete hardware configurations which leverage the NixOS Hardware modules via flake.nix.
- scripts: Helper scripts
- shells: Nix shell environments using direnv for infrequently used tools
The nixos/_mixins and home-manager/_mixins are a collection of composited configurations based on the arguments defined in flake.nix.
- Boot off a .iso image created by this flake using
rebuild-iso-desktop
orrebuild-iso-console
(see below) - Put the .iso image on a USB drive
- Boot the target computer from the USB drive
- Two installation options are available:
1 Use the graphical Calamares installer to install an adhoc system
2 Run
install-system <hostname> <username>
from a terminal- The install script uses Disko to automatically partition and format the disks, then uses my flake via
nixos-install
to complete a full-system installation - This flake is copied to the target user's home directory as
~/Zero/nix-config
- The install script uses Disko to automatically partition and format the disks, then uses my flake via
- Make a cuppa 🫖
- Reboot
- Login and run
rebuild-home
(see below) from a terminal to complete the Home Manager configuration.
If the target system is booted from something other than the .iso image created by this flake, you can still install the system using the following:
curl -sL https://raw.githubusercontent.com/wimpysworld/nix-config/main/scripts/install.sh | bash -s <hostname> <username>
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
A rebuild-host
alias is provided that does the following:
sudo nixos-rebuild switch --flake $HOME/Zero/nix-config
A rebuild-home
alias is provided that does the following:
home-manager switch -b backup --flake $HOME/Zero/nix-config
Aliases for rebuild-iso-desktop
(desktop) and rebuild-iso-console
(console only) are provided that create .iso images from this flake. They do the following:
pushd $HOME/Zero/nix-config
nix build .#nixosConfigurations.iso.config.system.build.isoImage
popd
A live image will be left in ~/$HOME/Zero/nix-config/result/iso/
. These .iso images are also periodically built and published via GitHub Actions and available in this project's Releases.
Nix is configured with flake support and the unified CLI enabled.
Here is the directory structure I'm using.
.
├── home-manager
│ ├── _mixins
│ │ ├── console
│ │ ├── desktop
│ │ ├── services
│ │ └── users
│ └── default.nix
├── nixos
│ ├── _mixins
│ │ ├── desktop
│ │ ├── hardware
│ │ ├── services
│ │ ├── users
│ │ └── virt
│ ├── designare
│ ├── iso
│ ├── skull
│ ├── vm
│ ├── z13
│ └── default.nix
├── overlays
├── pkgs
├── scripts
└── flake.nix
Fish shell with powerline-go and a collection of tools that deliver a somewhat "Modern Unix" experience. The base system has a firewall enabled and also includes OpenSSH, ZeroTier, Podman & Distrobox and, of course, a delightfully configured micro. (Fight me! 🥊)
MATE Desktop 🧉 and Pantheon 🏛️ are the two desktop options available. The font configuration is common with both 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.
Desktop | System | Configuration | Theme |
---|---|---|---|
MATE | MATE Install | MATE Configuration | Yaru Magenta (Dark) |
Pantheon | Pantheon Install | Pantheon Configuration | elementary Bubble Gum (Dark) |
Things I should do or improve
- Add Password Managers
- Integrate Borg Backups
- Integrate notify
- Integrate homepage
- Integrate agenix
or sops-nix - Bind Syncthing GUI to ZeroTier.
- Configure Plank.
- Defold
- Godot
- PICO-8
- Forgejo or Gitea
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 be incorporating many of the techniques it demonstrates in my nix-config.
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 is chasing the ideas outlined in these blog posts: