Skip to content

kevinrudde/nix-dotfiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

346 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nix-dotfiles

Requirements

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 upgrade

Homebrew

Some applications need to be installed through homebrew, so we just install it.

SOPS for secrets (optional)

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)

Setup

  1. Clone the repository
git clone git@github.com:kevinrudde/nix-dotfiles.git ~/.config/nix-dotfiles
  1. Apply the configuration with
~/.config/nix-dotfiles/scripts/rebuild-system.sh
  1. To apply future changes, run
rebuild-system

Directory Structure

The 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 through paru
  • migrations/: timestamped host migration scripts
  • default.nix: optional system module for hosts that have one

Host Migrations

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.sh

It 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-system

The script version also works before your shell aliases are loaded:

~/.config/nix-dotfiles/scripts/rebuild-system.sh

On 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.

Host Native Packages

Linux hosts can define native packages managed through paru in:

systems/<hostname>/packages.txt

Put 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.

MacOS Settings

Keyboard

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.

Shortcuts

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

Change default shell

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> 

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors