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 -s)).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,make sops-edit-system,make sops-edit-home.
flake.nix: inputs, host registry, shared builders for nix-darwin, NixOS, and standalone Home Manager.hosts/: per-host settingsdarwin/<host>/default.nixnixos/<host>/{hardware-configuration.nix,default.nix}
modules/shared: cross-platform settings (nix config, shells, common pkgs, SOPS tooling).modules/secrets.nix: optional per-host SOPS defaults.modules/darwin: macOS-specific settings split between core defaults and Homebrew bundles.modules/nixos: Linux-specific (placeholder; add boot/fs/impermanence here).home-manager/default.nix: base Home Manager identity, state version, and optional home-level SOPS defaults.home-manager/profiles: reusable stacks (common,darwin-common,workstation,server).home-manager/programs: HM modules (browser privacy, fish, firefox, git, tealdeer, VS Code, Zen).pkgs/,overlays/: custom packages and overlays.secrets/: SOPS-encrypted host and user secrets. Only encrypted files should be committed..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" "darwin-common" "workstation"]. commonincludes cross-platform shell/tooling (fish, starship, zoxide, atuin, carapace), aliases, catppuccin theme, and CLI defaults.darwin-commoncontains macOS-only Home Manager settings such as app linking and Homebrew-backed aliases.workstationcontains GUI/editor/browser Home Manager config.serveris a stub for future headless defaults.
Firefox and Zen Browser share the same hardened Firefox-family preferences from home-manager/programs/browser-privacy.nix. Zen uses programs.zen-browser.profiles.default.settings, as supported by 0xc000022070/zen-browser-flake, so the same telemetry, new-tab, password prompt, and HTTPS-only tightening applies there too.
Firefox-family extensions are managed from home-manager/programs/browser-extensions.nix:
- add an extension once in
registry - include it per browser in
browsers.firefoxorbrowsers.zen - prefer NUR packages when available, or use AMO
id+slugfor policy-installed latest XPI
Helium Browser is also declared:
- macOS installs the Homebrew cask
helium-browser - Linux hosts can use
oxcl/nix-flake-helium-browserthrough the Home Manager/NixOS modules, with default privacy-oriented Chromium policies inhome-manager/programs/helium.nix
- Rebuild macOS:
darwin-rebuild switch --flake .#<host>. - Rebuild NixOS:
sudo nixos-rebuild switch --flake .#<host>. - Switch Home Manager only:
home-manager switch --flake .#<user>@<host>. - Update inputs:
nix flake update. - Update Homebrew safely:
make flake-update-homebrew. - Edit system secrets:
make sops-edit-system. - Edit home secrets:
make sops-edit-home. - Verify secrets decrypt:
make sops-verify.
This repo uses sops-nix with age recipients derived from SSH public keys, similar to the referenced dotfiles pattern.
The reliable new-machine model is: encrypted secrets are copied by Git, and only one private user identity has to be restored from your password manager or backup.
- Restore your chosen SOPS SSH private/public key pair on the new machine and restrict the private key permissions.
- Set
SOPS_USER_KEYto the restored private key path. SetSOPS_USER_PUBKEYtoo if the public key is not atSOPS_USER_KEY.pub. - Clone this repo and run
make sops-user-recipient; it should match the expected user recipient in.sops.yaml. - Run
make sops-verifyto prove the restored key decrypts committed secrets. - Rebuild with
make darwin-rebuildormake home-manager-switch. - If the new machine needs system-level secrets, run
make sops-host-recipient, add that public recipient to.sops.yaml, then runsops updatekeys secrets/<host>.yamlfrom a machine that can already decrypt.
- System secrets live at
secrets/<host>.yamland are decrypted unattended with/etc/ssh/ssh_host_ed25519_keyafter the host recipient is enrolled. - Home Manager secrets live at
secrets/<host>/<user>.yamland are decrypted with a restored user SSH key. - Public recipients are listed in
.sops.yaml; private keys never belong in this repo. - Keep the user recipient on every secret file as your recovery path.
- 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.