Skip to content
NoSugarCoffeePublic

About

Personal Home Manager flake for macOS + Linux — reproducible, declarative, zero drift. Pinned to nixos-26.05.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

dotnix

nixpkgs home-manager License: MIT

Personal Home Manager dotfiles for Linux + macOS — reproducible, declarative, zero drift.


📖 Overview

Keeping a home environment consistent across machines usually means scattered configs, manual installs, and "works on my machine" drift. This flake declares the entire home environment as code — packages, dotfiles, and tool configs all version-controlled in one place — so one command applies a fully reproducible setup on any supported machine.

🚀 Quick start

New machine, no Nix installed — one-liner that installs Nix (via the Determinate installer) if missing and applies this flake. No local clone or git needed:

curl -fsSL https://raw.githubusercontent.com/NoSugarCoffee/dotnix/main/scripts/bootstrap-macos.sh | bash

If Nix wasn't installed yet, open a new terminal after the installer finishes and re-run.

Already have Nix, no home-manager yet — bootstrap the first switch:

# Linux
nix run .#home-manager -- switch --flake .#liangliangdai

# macOS
nix run .#home-manager -- switch --flake .#liangliangdai-aarch64-darwin

Day to day — once just is on PATH:

just switch

📦 Managed packages

🍎 🐧 Both 🍎 macOS only 🐧 Linux only
AI codex · claude-code · claude-desktop · pi · apm · ccstatusline · paperclip · orca · agent-access · bitwarden-cli · grok-bot ChatGPT —
Terminal kitty · zellij · zoxide · yazi · nix-zsh-completions — —
Editors intellij-idea-ultimate · cursor jetbrains-air · pulsar —
Dev git · git-open · gh · glab · docker (client) · docker-compose · asdf (go, nodejs, java, maven) · pnpm · python3 (ipython, pip) · just · lark-cli colima —
Browsers — google-chrome · ego-lite —
Screen obs-studio macshot —
Network clash-verge-rev — —
Utilities — albert · maccy · scroll-reverser · cida copyq

🔧 Commands

Command Description
just switch Apply the configuration
just build Build without switching
just generations Show Home Manager generations
just update Update flake inputs
just show Show flake outputs

🍴 Fork

The username is a single source of truth in flake.nix:

let
  username = "liangliangdai";

Everything else (homeConfigurations attribute names, home.username, homeDirectory, CI USERNAME, the bootstrap script's flake target) reads from there directly or via nix eval --raw .#username. Fork the repo and change just that string — that's the whole rebranding step.

📝 Notes

  • zsh is managed. Move an existing ~/.zshrc aside before the first switch; machine-local config goes in an untracked ~/.zshrc-local.
  • git config is not. Per-checkout identity needs includeIf paths, so ~/.gitconfig is hand-written.
  • Codex and Claude Code settings stay writable. A switch seeds them if missing and resets only the keys declared in apps/codex/managed.toml and apps/claude-code/settings.nix.
  • asdf pins Go / Node / Java / Maven to explicit versions in apps/asdf/default.nix. Python comes from nixpkgs instead, since asdf compiles it from source.
  • Docker on macOS is colima. A launchd agent starts the VM at login; resize it with colima stop && colima start --cpu 4 --memory 8. On Linux the daemon is a system service, out of scope here.
  • Ad-hoc-signed macOS apps are re-signed locally. Nix builds like kitty and Albert carry a signature that changes with every rebuild, which silently invalidates Accessibility / Screen Recording grants. A switch re-signs their copies in ~/Applications/Home Manager Apps with a self-signed dotnix local code signing certificate it creates in the login keychain, so grants survive updates. The first switch that migrates an app to this identity still changes its code identity once -- macOS treats that as a new app, so expect to re-grant Accessibility / Screen Recording for kitty and Albert one more time right after that switch; it then sticks across every rebuild after. Without a login keychain at ~/Library/Keychains/login.keychain-db (headless activation, CI) it warns and leaves the copy ad-hoc signed instead of failing.
  • China mirrors. scripts/bootstrap-macos.sh adds SJTU/TUNA/USTC substituters; check with nix config show | grep substitut.

📄 License

MIT — see LICENSE.

About

Personal Home Manager flake for macOS + Linux — reproducible, declarative, zero drift. Pinned to nixos-26.05.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages