A personal NixOS configuration repository managed with Flakes and Home Manager. Yes, another dotfiles repo — but at least this one is fully declarative and reproducible (in theory).
This flake defines system configurations for multiple machines and a macOS home setup, all managed from one place. Overlays, custom packages, and various modules are included for convenience. The goal is to go from bare metal to a fully configured system with a single command.
Four configurations are defined:
- elendil — NixOS on a Microsoft Surface Pro (x86_64-linux). KDE Plasma 6, Fish shell, Docker, Steam, PipeWire, and the usual hardware tweaks to make everything work.
Custom kernel: Zen-based kernel with Linux Surface patches, tuned for low latency and Surface hardware support (drivers for touchscreen, cameras, sensors, etc.). Defined in
pkgs/kernel/. Cloud drives: OneDrive, ProtonDrive and Google Drive mounted at login via rclone systemd user services (home/elendil/default.nix). - mgengarelli / work-darwin — macOS home + nix-darwin configuration (aarch64-darwin). GUI apps (Ghostty, Proton suite, etc., plus Mac App Store apps via
mas) are managed declaratively through Homebrew via nix-darwin (system/work-darwin/); CLI tools and dotfiles stay in Home Manager (home/work-darwin/). - massi@mithrandir — macOS home + nix-darwin configuration (aarch64-darwin) for a new MacBook Pro. GUI apps (Ghostty, Proton suite, Google Drive, Steam, WhatsApp, etc.) are managed declaratively through Homebrew via nix-darwin (
system/mithrandir/); CLI tools and dotfiles stay in Home Manager (home/mithrandir/). - mgengarelli@curunir — macOS home + nix-darwin configuration (x86_64-darwin) on a Surface Laptop 3 running OpenCore. Uses a pinned nixpkgs (
nixos-26.05) because nixpkgs dropped x86_64-darwin support after that release. Overlays are disabled entirely because they reference packages built against nixpkgs-unstable and are ABI-incompatible with the older pinned set. GUI apps (Ghostty, Proton suite, etc.) are managed declaratively via Homebrew through nix-darwin; CLI tools stay in nixpkgs via Home Manager.
This flake uses Home Manager to manage per-user configurations across systems.
- fish — Fish shell with plugins and modern Unix utilities
- ghostty — Ghostty terminal emulator with custom keybindings
- neovim — NeoVim with mini.nvim framework and LSP support
- opencode — OpenCode AI assistant with MCP servers
- devops — Kubernetes, Terraform, Ansible, Azure CLI (kubectl, helm), K9s, Vault, Tanzu
- git — Git with Delta for diffs and custom aliases
- firefox — Firefox with privacy policies and pre-configured extensions
- fonts — Font management with monospace fonts, NerdFonts, and custom families
Steps for a fresh NixOS installation:
- Boot the minimal NixOS ISO from a USB stick.
- Partition and format the disks as needed, then mount the root filesystem at
/mnt. - Generate a hardware configuration:
nixos-generate-config --root /mnt
- Copy the generated
hardware-configuration.nixinto the appropriate system directory (e.g.,system/elendil/). - Clone this repository to
/mnt/etc/nixosor your preferred location. - Review and adjust the configuration for your hardware and preferences.
Note: before the first switch, configure the rclone remotes with
rclone config— the mount services useOneDrivePersonal,proton, andgdrive. Therclone-*systemd user services will fail to mount until those remotes exist. - Build and switch:
nixos-rebuild switch --flake .#elendil
Home-manager + nix-darwin. GUI apps are managed by Homebrew through nix-darwin; CLI tools and dotfiles are managed by Home Manager.
darwin-rebuild switch --flake .#work-darwin # nix-darwin + Homebrew
home-manager switch --flake .#mgengarelli # dotfilesNote: the system config decrypts a Cloudflare CA cert secret via
agenix; it expects an age identity at
/Users/mgengarelli/.age/key.txt.
Home-manager + nix-darwin. GUI apps are managed by Homebrew through nix-darwin; CLI tools and dotfiles are managed by Home Manager.
darwin-rebuild switch --flake .#mithrandir # nix-darwin + Homebrew
home-manager switch --flake .#"massi@mithrandir" # dotfilesNote: Before the first darwin-rebuild switch, manually uninstall any
Proton apps (VPN, Drive, Pass) already in /Applications — Homebrew will
refuse to install a cask over an existing manual installation.
Home-manager + nix-darwin. GUI apps are managed by Homebrew through nix-darwin; CLI tools and dotfiles are managed by Home Manager. Requires an existing OpenCore boot setup on x86_64 hardware (Surface Laptop 3).
This configuration assumes VoltageShift is already installed and configured. VoltageShift is a macOS kernel extension (kext) that allows CPU undervolting and power limit tuning. It is not managed by Nix and must be set up manually:
- Install the kext and binary — follow the instructions at
VoltageShift. The binary must be
at
/usr/local/bin/voltageshift. - Add the kext to OpenCore — mount the EFI partition, add
VoltageShift.kexttoEFI/OC/Kexts/, and add a corresponding entry to yourconfig.plistunderKernel → Add. See the VoltageShift README for the exact plist entry.
Once installed, home-manager handles the rest: a sleepwatcher agent runs on
login and applies CPU power limits (voltageshift power 17 25) every time the
machine wakes from sleep.
darwin-rebuild switch --flake .#curunir # nix-darwin + Homebrew
home-manager switch --flake .#"mgengarelli@curunir" # dotfilesNote: Before the first darwin-rebuild switch, manually uninstall any
Proton apps (VPN, Drive, Pass) already in /Applications — Homebrew will
refuse to install a cask over an existing manual installation.
This configuration uses a pinned nixpkgs (nixos-26.05) because nixpkgs
dropped x86_64-darwin support after that release. Overlays are disabled, so
some packages (mcp-atlassian) use stubs.
This configuration is personal, but feel free to take inspiration. To adapt it for your own use:
- Copy a system configuration directory (e.g.,
system/elendil/) and rename it - Update the hostname in the configuration files
- Adjust
hardware-configuration.nixfor your hardware - Run
nixos-rebuild switch --flake .#your-hostname
The key directories:
system/— NixOS system configurations per host.home/— Home Manager modules (neovim, fish, firefox, and more).pkgs/— Custom package overlays and definitions. Some packages are platform-conditional (e.g.mcp-atlassianis excluded onx86_64-darwinwhere its dependency tree is broken).lib/— Shared utility functions.
See LICENSE for details.