This repository contains a Nix Flake for configuring my computers and home environment. These are the computers this configuration currently manages:
| Hostname | OEM | Model / CPU | OS | Role | Status |
|---|---|---|---|---|---|
alien |
Alienware | A100 Steam Machine | NixOS | Desktop | TBD |
kuroi |
Dell | Dell Latitute E5470 | NixOS | Laptop | Live π§ |
obsidian |
DIY | AMD Ryzen 9 3900X | NixOS | Desktop | Live |
sktc0 |
Apple | Apple M1 Pro | macOS | Laptop | Live |
nuc0 |
Intel | Pentium N3700 | NixOS | Server | TBD |
nuc1 |
Intel | Pentium N3700 | NixOS | Server | TBD |
nuc2 |
Intel | Pentium N3700 | NixOS | Server | TBD |
nuc3 |
Intel | Pentium N3700 | NixOS | Server | TBD |
nuc4 |
Intel | Pentium N3700 | NixOS | Server | Live |
nuc5 |
Intel | Pentium N3700 | NixOS | Server | Live |
nuc6 |
Intel | Pentium N3700 | NixOS | Server | Live |
nuc7 |
Intel | Pentium N3700 | NixOS | Server | TBD |
nuc8 |
Intel | Pentium N3700 | NixOS | Server | TBD |
nuc9 |
Intel | Pentium N3700 | NixOS | Server | Live |
rpi2 |
Raspberry Pi | Raspberry Pi 2 | NixOS | Server | WIP |
The Graveyard: Decommissioned machines, configurations may be outdated or missing.
| Hostname | OEM | Model / CPU | OS | Role | Status |
|---|---|---|---|---|---|
glass |
DIY | AMD Ryzen 9 3900X | NixOS | Desktop | RIP πͺ¦ |
shiroi |
DIY | Celeron G1610T | NixOS | Server | RIP πͺ¦ |
t510 |
Lenovo | Thinkpad T510 | NixOS | Laptop | RIP πͺ¦ |
tegra0 |
Nvidia | Tegra K1 | NixOS | Server | RIP πͺ¦ |
tegra1 |
Nvidia | Tegra K1 | NixOS | Server | RIP πͺ¦ |
tegra2 |
Nvidia | Tegra K1 | NixOS | Server | RIP πͺ¦ |
tegra3 |
Nvidia | Tegra K1 | NixOS | Server | RIP πͺ¦ |
tegra4 |
Nvidia | Tegra K1 | NixOS | Server | RIP πͺ¦ |
This project was forked from Wimpy's nixcfg repository, which you can find here. There is plenty of documentation to update so you will see plenty that is out of date here.
- .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.
- Two options for booting up into the installer:
- ISO images
- Boot off a .iso image created by this flake using
rebuild-iso-desktoporrebuild-iso-console(see below) - Put the .iso image on a USB drive
- Boot the target computer from the USB drive
- Boot off a .iso image created by this flake using
- PXE netboot image
- Prerequsite: Have a local system running the
pixiecore-pxe.nixservice mixin - Boot your device into network PXE environment
- Prerequsite: Have a local system running the
- ISO images
- Two installation options are available:
- Use the graphical Calamares installer to install an adhoc system (only available on
iso-desktop) - Run
install-system <hostname> <username> <system-type>from a terminal- The install script uses Disko to automatically partition and format the disks, then uses my flake via
nixos-installto complete a full-system installation - This flake is copied to the target user's home directory as
~/0xc/nixcfg
- The install script uses Disko to automatically partition and format the disks, then uses my flake via
- Use the graphical Calamares installer to install an adhoc system (only available on
- 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/tcarrio/nixcfg/main/scripts/shell/install.sh | bash -s <hostname> <username> <type>This repository provides a couple of recovery ISO images. They are loosely based on the functionality of tools like SystemRescue. Like the other ISO images, there are console and desktop variants. The desktop variant includes all tools from the console variant, but in addition has some useful graphical tools.
Console
Desktop
Now, building! Run nix build .#nixosConfigurations.iso-recovery-(console|desktop).config.system.build.isoImage, specifying either console or desktop.
TBD.
For now, build the image with:
nix-build '<nixpkgs/nixos>' -A config.system.build.sdImage -I nixos-config=./sdcard/rpi2.nix
# outputs to ${REPO_DIR}/result
zstdcat ./result/sd-image/nixos-sd-image-*-aarch64-linux.img.zst | dd bs=1M iflag=fullblock of=/dev/sde status=progressThe nix-darwin project provides support for managing macOS systems with Nix in a similar fashion to NixOS. With this, we can ensure that the system has everything we need available and that we can reproduce a working development environment with minimal overhead.
For the most part, the scripts/shell/bootstrap-darwin-machine.sh Bash script provides sufficient automation to get a macOS machine fully configured from scratch. This includes installation of Nix through the nixos.org installer then utilizes the latest main ref and Nix dev shells to execute the commands. This infers the targets based on your hostname and username per the darwin-rebuild and home-manager standard, such that darwin-rebuild uses the $hostname for your default target, and home-manager uses $username@$hostname. An example of this is tcarrio@glass. On my glass workstation with the current user tcarrio, no additional arguments would need to be passed.
Note: Because of this, the script does not support additional arguments yet.
You can often speed things up on smaller systems by delegating the build to another. For example, you might have a NixOS configuration that you could build on e.g. a 32-core AMD that you then deploy or copy resources from to an older dual-core machine. Compiling Rust programs on 3rd-gen Intels? No way!
You can do the following with a few different Nix commands:
remoteUser="foo"
remoteHost="bar"
hostname="baz"
# suppose we have a nixos system config defined in our flake
nix build .#nixosConfigurations.$hostname.config.system.build.toplevel
# we can get a reference to its path in the Nix store with
drvPath="$(nix eval ".#nixosConfigurations.$hostname.config.system.build.toplevel" --json | jq -r .)"
# now we built it locally, we could copy it to a remote system
nix-copy-closure --to $remoteUser@$remoteHost "$drvPath"
## OR, if you have a live system, nixos-rebuild encapsulates this logic and more
nixos-rebuild switch --flake .#$hostname --target-host $remoteUser@$remoteHostI clone this repo to ~/0xc/nixcfg. NixOS and Home Manager changes are applied separately because I have some non-NixOS hosts.
git clone git@github:tcarrio/nixcfg ~/0xc/nixcfgA rebuild-host alias is provided that does the following:
sudo nixos-rebuild switch --flake $HOME/0xc/nixcfgA rebuild-home alias is provided that does the following:
home-manager switch -b backup --flake $HOME/0xc/nixcfgAliases 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/0xc/nixcfg
nix build .#nixosConfigurations.iso.config.system.build.isoImage
popdA live image will be left in ~/$HOME/0xc/nixcfg/result/iso/. These .iso images are also periodically built and published via GitHub Actions and available in this project's Releases.
This flake provides several custom packages available through pkgs in your NixOS or Home Manager configurations:
kube-rsync- Kubernetes rsync utilityzeit- Time tracking toolgqurl- GraphQL URL utility (built with Bun)nixvim- Pre-configured Neovim with plugins and Tokyo Night theme
The nixvim package provides a fully configured Neovim setup with LSP, treesitter, telescope, and more. It uses the Tokyo Night "storm" theme by default.
# In your configuration.nix or home.nix
environment.systemPackages = with pkgs; [
nixvim
];The nixvim package includes:
- Tokyo Night "storm" colorscheme
- LSP support (Lua, Nix, Rust, TypeScript)
- Treesitter syntax highlighting
- Telescope fuzzy finder
- File explorer (nvim-tree)
- Terminal integration (toggleterm)
- Git integration (fugitive, gitsigns)
- Autocompletion with nvim-cmp
- Status line with lualine
The package can be customized by modifying the configuration files in pkgs/nixvim/. For complex customizations, consider forking the configuration or using nixvim directly in your system configuration.
Nix is configured with flake support and the unified CLI enabled.
Here is the directory structure I'm using.
.
βββ darwin
β βββ mixins -> ../nixos/mixins/
β βββ default.nix
β βββ sktc0
βββ home-manager
β βββ mixins
β β βββ console
β β βββ desktop
β β βββ services
β β βββ users
β βββ default.nix
βββ lib
β βββ default.nix
β βββ helpers.nix
β βββ ssh-matrix.nix
βββ LICENSE
βββ nixos
β βββ mixins
β β βββ av
β β βββ console
β β βββ desktop
β β βββ hardware
β β βββ services
β β βββ users
β β βββ virt
β βββ default.nix
β βββ iso
β β βββ iso-console
β β βββ iso-desktop
β β βββ iso-nuc
β βββ server
β β βββ NUC.md
β β βββ nuc0
β β βββ pxe-server
β βββ workstation
β βββ glass
β βββ kuroi
β βββ t510
β βββ vm
βββ overlays
βββ pkgs
βββ scripts
βββ sdcard
βββ secrets
βββ shells
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) |
- Add all computers to the table
- Implement Disko partitioning
- Integrate .iso building
- Integrate OpenRGB
- Integrate OpenRazer
- Integrate StreamDeck
- Integrate Xone
-
Migrate (maybe) to ZFS, with backups viazrepl - Fix Magewell mwprocapture driver: nixpkgs#221209
- Support Raspberry Pi installer
- With Nix flakes
- Support macOS with nix-darwin
- Support Roccat tools with group-based access control for hidraw
- Integrate an Emoji picker
- Integrate AppCenter and Flathub
- Integrate Steam
- Add Ferdium, Rambox or Wavebox
- Add Password Managers
- Add Bitwarden
- Add 1Password
- Integrate Borg Backups
-
Integrate cockpit (server) - Integrate notify
- Integrate Plex
- Integrate homepage
- Integrate fwupd
- Integrate Keybase
- Integrate Syncthing
- Integrate sshguard
- Embed install script in the ISO
- Integrate agenix
or sops-nix - Integrate capabilities from nix-starter-configs
- Integrate wallpapers
- Integrate faces
- Include Serif fonts
- Include fallback fonts for Work Sans, Fira Code and Joypixels
- Create common user settings and discrete user settings
- Move application defaults out of the desktop defaults
- Create standard directories in
/home/tcarriousingsystemd.user.tmpfiles.rules. - Create
.envrcfiles in/home/tcarrio. - Bind Syncthing GUI to ZeroTier.
- Configure Plank.
- Fix Unfree in Home Manager)
- Defold
- Godot
- PICO-8
- emacs
- fzf
- tmate or tmux
- neovim
- nnn
or broot or felix or ranger
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 nixcfg.
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:

