Skip to content

Migrate dotfiles to Nix Flakes + home-manager + nix-darwin - #3

Draft
thiskevinwang with Copilot wants to merge 3 commits into
mainfrom
copilot/migrate-dotfiles-to-nixos
Draft

thiskevinwang with Copilot wants to merge 3 commits into
mainfrom
copilot/migrate-dotfiles-to-nixos

Conversation

Copilot AI commented Aug 29, 2026 •

Copy link
Copy Markdown

Homebrew/bash-script setup (Brewfile, install.sh) is mac-only, imperative, and hard to keep reproducible across machines. This introduces a Nix Flakes-based setup as the primary path, portable across macOS (nix-darwin) and Linux (NixOS/standalone home-manager), while leaving the legacy setup in place as fallback.

Flake entry point

  • flake.nix: inputs (nixpkgs, nixpkgs-unstable, home-manager, nix-darwin) and outputs for darwinConfigurations.macbook, nixosConfigurations.linux-desktop, and standalone homeConfigurations."kevin@linux|darwin".

home-manager modules (shared across platforms)

  • home/shells.nix — zsh, oh-my-zsh, zsh-completions, pure prompt
  • home/editors.nix — vim/neovim, VSCode extensions, zed settings + AGENTS.md
  • home/terminal.nix — tmux (+ tmux-powerline), ghostty
  • home/programs.nix — CLI tools ported from Brewfile
  • home/default.nix — wires the above together, sets home.stateVersion

System-level configs

  • nix/darwin.nix — Caps Lock → Control remap, TouchID sudo, unfree packages allowed
  • nix/linux.nix — minimal machine-agnostic NixOS base (placeholders for fileSystems/bootloader, meant to be overridden per host)

Docs

  • README.md updated with Nix quickstart (macOS/Linux/standalone), repo layout, and machine-customization notes; existing Homebrew/bash flow kept as a documented "Legacy Homebrew setup" fallback.

Example — applying on a Mac:

git clone https://github.com/thiskevinwang/dotfiles.git && cd dotfiles
nix run nix-darwin -- switch --flake .#macbook

Validated end-to-end with nix flake check (no local nix binary in this environment, so run via a nixos/nix Docker container); this surfaced and required fixing several real issues: programs.vscode.profiles doesn't exist in the pinned home-manager release, pkgs.tmuxPlugins.tpm doesn't exist (switched to tmuxPlugins.tmux-powerline), webp renamed to libwebp, VSCode requiring nixpkgs.config.allowUnfree, and NixOS requiring fileSystems/bootloader assertions to satisfy evaluation.

Copilot AI and others added 2 commits August 29, 2026 11:18
Co-authored-by: thiskevinwang <26389321+thiskevinwang@users.noreply.github.com>
Co-authored-by: thiskevinwang <26389321+thiskevinwang@users.noreply.github.com>
Copilot AI changed the title [WIP] Migrate Homebrew-based macOS dotfiles to NixOS with home-manager Migrate dotfiles to Nix Flakes + home-manager + nix-darwin Aug 29, 2026
Copilot AI requested a review from thiskevinwang August 29, 2026 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants