Cross-platform flake with Home Manager profiles, shared modules, and per-host overrides.
- Prereqs: Nix with flakes enabled (
export NIX_CONFIG="experimental-features = nix-command flakes"). - Clone:
git clone https://github.com/sm17p/dotfiles. - macOS apply:
darwin-rebuild switch --flake .#sakatagintoki(or.#hijikatatoshiro). - NixOS apply:
sudo nixos-rebuild switch --flake .#<nixos-host>.
make bootstrap-mac— installs Nix, then nix-darwin usingFLAKE(defaults to.#$(hostname)).make darwin-rebuild— rebuilds nix-darwin with the currentFLAKE.- Override host:
make darwin-rebuild FLAKE=.#sakatagintoki. - Other helpers:
make flake-update,make flake-update-homebrew,make flake-check,make nix-gc,make home-manager-switch.
flake.nix: inputs, hosts map, mkHost dispatcher.hosts/: per-host settingsdarwin/<host>/default.nixnixos/<host>/{hardware-configuration.nix,default.nix}
modules/shared: cross-platform settings (nix config, shells, common pkgs).modules/darwin: macOS-specific (fonts, homebrew, touch ID).modules/nixos: Linux-specific (placeholder; add boot/fs/impermanence here).home-manager/profiles: reusable stacks (common,workstation,server).home-manager/programs: HM modules (aliases, fish, firefox, git, tealdeer).pkgs/,overlays/: custom packages and overlays..agents/skills/: canonical repo-tracked Agent Skills for cross-tool reuse.
This repo keeps portable Agent Skills in .agents/skills/. That directory is
the source of truth for the skill content, but it is not itself a discovery path
for every client. Each tool still needs the skills linked or installed into its
own native location.
Current skills:
jj-commit: writes a multi-linejj describemessage for an explicit revset.jj-push: creates or moves a bookmark and pushes it toorigin.
Manual hookup examples:
- Codex:
ln -s "$PWD/.agents/skills/jj-commit" ~/.codex/skills/jj-commitandln -s "$PWD/.agents/skills/jj-push" ~/.codex/skills/jj-push - Claude Code:
ln -s "$PWD/.agents/skills/jj-commit" ~/.claude/skills/jj-commitandln -s "$PWD/.agents/skills/jj-push" ~/.claude/skills/jj-push - Gemini CLI:
gemini skills link "$PWD/.agents/skills/jj-commit"andgemini skills link "$PWD/.agents/skills/jj-push"
Gemini also supports installing or linking skills through its native skills commands. Codex and Claude pick them up from their own skill directories after the link or copy is in place.
- Add host metadata in
flake.nixunderhostswithtype(darwin/nixos),system,user,modulesPath, andprofiles. - Create
hosts/<platform>/<host>/default.nix(andhardware-configuration.nixfor NixOS). - Rebuild with
darwin-rebuild switch --flake .#<host>ornixos-rebuild switch --flake .#<host>.
- Profiles live in
home-manager/profiles. Each host lists profiles inflake.nix, e.g.["common" "workstation"]. commonincludes shell/tooling (fish, starship, zoxide, atuin, carapace), aliases, catppuccin theme, and defaults.workstationandserverare stubs to extend for GUI/headless needs.
- Rebuild macOS:
darwin-rebuild switch --flake .#<host>. - Rebuild NixOS:
sudo nixos-rebuild switch --flake .#<host>. - Update inputs:
nix flake update. - Update Homebrew safely:
make flake-update-homebrew.
- Attribute renames: if
pkgs.systemwarnings appear, usepkgs.stdenv.hostPlatform.system. - Package renames: on macOS use
docker-desktopinstead ofdocker. - If a profile change doesn’t load, ensure the host’s
profileslist inflake.nixincludes it. - If
darwin-rebuildfails duringbrew bundlewith unreadable cask or DSL/arity errors, refreshbrew-src,nix-homebrew,homebrew-bundle,homebrew-core, andhomebrew-casktogether instead of editing individual casks.