Imported from alDuncanson/dotfiles (
AGENTS.md). Install upstream withnpx skills add alDuncanson/dotfiles. Copyright stays with the author.
Dotfiles
Agent guide. Declarative macOS user environments in Nix, applied with Home Manager.
flake.nix: inputs, imports and exports thedotfilesflake module, declares thepersonalprofiledotfiles.nix: the flake module. A function of this flake's inputs; definesdotfiles.*, importsmodules/, turnsdotfiles.profilesintohomeConfigurations, and exportshomeModules.defaultmodules/: dendritic feature modules, one concern per file. Each contributes Home Manager config throughdotfiles.home.shared;nvim.nixalso contributes flake outputs throughperSystempersonal.nix: the personal profile's Home Manager module- Other machines declare their profile in their own flake with
dotfilesas the only input; seeREADME.md
Commands
nix fmtandnix flake checknix run home-manager -- build --flake .#personal, thenswitchnix run .#neovim -- --headless '+qa!'after any Neovim changenix flake update, then build,nix flake check, and the Neovim smoke test before committing- Refactor check:
nix build --no-link --print-out-paths .#homeConfigurations.personal.activationPackagebefore and after; the same path means nothing changed
Rules
- Nix files hold code only. Rationale goes in commit messages or here.
- Every file under
modules/is a flake-parts module. Read inputs throughconfig.dotfiles.inputs, never theinputsargument, which belongs to whichever flake is importing. Shared values go indotfiles.lib.*, notspecialArgs. - Name files by concern. Config in a foreign syntax, like the Starship TOML, stays in an adjacent file loaded by its module.
flake.nixstays wiring only.- Conventional commits:
feat(nvim): ...,fix(programs): ...,docs(agents): .... - Public repo: no secrets and nothing employer-specific. That lives in the private work flake.
Neovim
modules/nvim.nix holds the nvf settings and the exported .#neovim package.
Both build through dotfiles.lib.mkPkgs, so unfree packages are allowed there,
not in a module. To check an nvf option against the pinned source:
nix eval --impure --raw --expr 'let flake = builtins.getFlake (toString ./.); in flake.inputs.nvf.outPath'