1
0
Fork
You've already forked system
0
NixOS configuration and dotfiles
  • Lua 38.9%
  • Shell 20.4%
  • Nix 18.7%
  • Python 10.7%
  • C 7.2%
  • Other 4%
Find a file
2026年06月27日 16:48:37 +02:00
assets add more fonts 2026年05月15日 12:29:20 +02:00
dotfiles swap pi for omp 2026年06月27日 16:48:37 +02:00
home swap pi for omp 2026年06月27日 16:48:37 +02:00
host add voxtype, tmux pane swap bindings 2026年06月15日 13:02:50 +02:00
packages kagi-cli, firefox fix for rakka 2026年06月26日 13:10:47 +02:00
flake.lock swap pi for omp 2026年06月27日 16:48:37 +02:00
flake.nix swap pi for omp 2026年06月27日 16:48:37 +02:00
justfile fix justfile bug, add dap, some smaller tweaks 2026年06月01日 22:00:53 +02:00
README.md Add hoshijiro VPS host (NixOS migration from Fedora) 2026年05月08日 11:54:50 +02:00
rebuild.sh Add hoshijiro VPS host (NixOS migration from Fedora) 2026年05月08日 11:54:50 +02:00

system

NixOS configuration for multiple hosts, managed with flakes and home-manager.

Structure

host/
 default.nix # shared base config (locale, shells, gc, ...)
 <hostname>/
 default.nix # host-specific config
 hardware.nix # generated hardware config
home/
 default.nix # shared user config (packages, dotfiles, services, ...)
 <username>/
 default.nix # user-specific config

Bootstrapping a new host

1. Clone the repo

git clone https://github.com/wintermute-cell/system /etc/nixos-config

2. Generate hardware config

nixos-generate-config --show-hardware-config > /etc/nixos-config/host/<hostname>/hardware.nix

3. Create host/<hostname>/default.nix

Copy an existing host as a starting point. At minimum set networking.hostName and system.stateVersion (use the current NixOS version).

4. Register the host in flake.nix

Add a new entry under nixosConfigurations, declaring which users exist and their home-manager config (see existing hosts as reference).

5. Switch

sudo nixos-rebuild switch --flake /etc/nixos-config#<hostname>

Or use rebuild.sh, which picks the hostname automatically.

Post-install steps

These are one-time imperative steps that can't be done declaratively and must be repeated on each new machine.

Thunderbolt dock authorization

Bolt manages Thunderbolt security but device trust is intentionally imperative (you're trusting a specific physical device). After plugging in a dock:

boltctl list # find the uuid
sudo boltctl enroll <uuid> # permanently authorize it

Only needs to be done once per device — enrollment persists across rebuilds.

Updating

./rebuild.sh # updates flake inputs and rebuilds
./rebuild.sh --no-update # rebuild without updating inputs

xremap

xremap handles keyboard remapping. It uses a two-process design to support multiple simultaneously logged-in users without one user blocking input for another.

  • System service (xremap-socket): runs as root, holds exclusive grab on physical keyboards, applies global remaps (CapsLock→Ctrl, hj→Esc). Uses the socket feature so it can receive window focus info without needing niri IPC directly.
  • Per-user bridge (xremap-niri): runs in each user's session, connects to niri IPC to watch the focused window, and forwards that info to the system service over a socket. This enables app-specific keymaps (e.g. emacs keys in Firefox).

The two binaries are compiled from the same source with different feature flags, which is why they are built as separate derivations in flake.nix.