You need to install Nix, but we are not using their official installer. Instead, we are using the Determinate Systems Nix Installer. You can download it here!
To update your Nix version to the latest recommended release, use the following command
sudo determinate-nixd upgradeSome applications need to be installed through homebrew, so we just install it.
If you want to have your secrets decrypted lying in the repository, you need to have you age key located at /home/<username>/.config/sops/age/keys.txt (linux) or /Users/<username>/Library/Application Support/sops/age/keys.txt (darwin)
- Clone the repository
git clone git@github.com:kevinrudde/nix-dotfiles.git ~/.config/nix-dotfiles- Apply the configuration with
~/.config/nix-dotfiles/scripts/rebuild-system.sh- To apply future changes, run
rebuild-systemThe repository is organized by responsibility:
.
├── home/ # Home Manager entrypoints and reusable user features
├── systems/
│ ├── <hostname>/ # Host-specific system files, native packages, migrations
│ └── shared/ # Shared system modules
├── scripts/ # Rebuild, migration, and sync entrypoints
├── migrations/.templates/ # Templates for generating new host migrations
└── bin/ # Checked-in helper scripts used by hosts or migrations
Common host-owned files live under systems/<hostname>/:
packages.txt: native packages installed throughparumigrations/: timestamped host migration scriptsdefault.nix: optional system module for hosts that have one
This repository includes a host migration system for Linux and macOS machines. The goal is to keep one-off setup steps separate from declarative state, while still making them repeatable and easy to audit.
Migration files live in:
systems/<hostname>/migrations/They are simple timestamped shell scripts such as 2026-04-14-init.sh. The runner executes them in filename order and records applied migrations under:
~/.local/state/nix-dotfiles/migrations/system/<hostname>You can run migrations manually from the repo root with:
./scripts/migrate.sh --host <hostname>To create a new migration from the template, run:
./scripts/new-migration.shIt will ask for a hostname and a short description, then create an executable file in systems/<hostname>/migrations/ with a timestamped filename.
The standard rebuild entrypoint is:
rebuild-systemThe script version also works before your shell aliases are loaded:
~/.config/nix-dotfiles/scripts/rebuild-system.shOn Linux it runs host migrations and then applies the matching Home Manager configuration for <user>@<hostname>. On macOS it runs host migrations and then applies the matching nix-darwin configuration for <hostname>. This keeps migrations out of Home Manager activation and makes rebuilds the single entrypoint.
To add a new migration, use ./scripts/new-migration.sh or copy migrations/.templates/host-migration.sh.template into systems/<hostname>/migrations/ and rename it to a timestamped .sh file. Keep each migration idempotent so it is safe even if you need to clear state and re-run it during development. These migrations run as the invoking user; if something truly needs root, keep that escalation explicit inside the migration itself, like the intel-lpmd example for deimos, instead of silently running the whole migration stream as root.
Linux hosts can define native packages managed through paru in:
systems/<hostname>/packages.txtPut one package name per line. Empty lines and # comments are ignored.
During rebuild-system, Linux hosts run:
./scripts/paru-sync.sh --host <hostname>If there is no package file for a host, the sync step is skipped.
I am using the standard german layout, to have the same layout as Windows and Linux.
- Go to "Sytem Settings > Keyboard > Text Input".
- There you can change the layout by clicking on edit.
- Now another window is opening. Click on + in the left side to add another layout.
- Select German and then "German - Standard". Save it.
I have swapped my ctrl and cmd key on my external keyboard. You can simply do that aswell.
- Go to "Sytem Settings > Keyboard" and click on "Keyboard Shortcuts...".
- Switch to the "Modifier Keys" tab and select your external keyboard in the top
- Set Control to Command and Command to Control
You can change your default shell with
chsh -s <Change this to your shell path which you can find in /etc/shells there is a comment with shells managed by nix>