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 |
---|---|---|---|---|---|
sktc0 |
Apple | Apple M1 Pro | macOS | Laptop | Done |
glass |
DIY | AMD Ryzen 9 3900X | NixOS | Desktop | Done |
kuroi |
Dell | Dell Latitute E5470 | NixOS | Laptop | Done |
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 | TBD |
nuc5 |
Intel | Pentium N3700 | NixOS | Server | TBD |
nuc6 |
Intel | Pentium N3700 | NixOS | Server | TBD |
nuc7 |
Intel | Pentium N3700 | NixOS | Server | TBD |
nuc8 |
Intel | Pentium N3700 | NixOS | Server | TBD |
nuc9 |
Intel | Pentium N3700 | NixOS | Server | TBD |
rpi2 |
Raspberry Pi | Raspberry Pi 2 | NixOS | Server | WIP |
shiroi |
DIY | Celeron G1610T | NixOS | Server | TBD |
tegra0 |
Nvidia | Tegra K1 | NixOS | Server | TBD |
tegra1 |
Nvidia | Tegra K1 | NixOS | Server | TBD |
tegra2 |
Nvidia | Tegra K1 | NixOS | Server | TBD |
tegra3 |
Nvidia | Tegra K1 | NixOS | Server | TBD |
tegra4 |
Nvidia | Tegra K1 | NixOS | Server | TBD |
t510 |
Lenovo | Thinkpad T510 | NixOS | Laptop | Done |
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.
- 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:
- Use the graphical Calamares installer to install an adhoc system
- 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
~/0xc/nixcfg
- 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://github.com/raw/tcarrio/nixcfg/main/scripts/install.sh | bash -s <hostname> <username> <type>
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=progress
The 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.
I 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/nixcfg
A rebuild-host
alias is provided that does the following:
sudo nixos-rebuild switch --flake $HOME/0xc/nixcfg
A rebuild-home
alias is provided that does the following:
home-manager switch -b backup --flake $HOME/0xc/nixcfg
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/0xc/nixcfg
nix build .#nixosConfigurations.iso.config.system.build.isoImage
popd
A 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.
Nix is configured with flake support and the unified CLI enabled.
Here is the directory structure I'm using.
.
βββ android
β βββ mixins -> ../nixos/mixins/
β βββ default.nix
β βββ pixel6a
βββ 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-gpd-dsi
β β βββ iso-gpd-edp
β β βββ iso-nuc
β β βββ iso-tk1
β β βββ iso-win-max
β βββ server
β β βββ brix
β β βββ NUC.md
β β βββ nuc0
β β βββ pxe-server
β β βββ skull
β β βββ tk1
β βββ 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 (skull)
- 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/tcarrio
usingsystemd.user.tmpfiles.rules
. - Create
.envrc
files in/home/tcarrio
. - Bind Syncthing GUI to ZeroTier.
- Configure Plank.
- Fix Unfree in Home Manager)
- Defold
- Godot
- PICO-8
- emacs
- fzf
- tmate or tmux
- micro
- 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: