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-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.
- 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.
- 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.