mirror of
https://github.com/smg1024/nix-darwin.git
synced 2026-05-22 20:32:59 +09:00
Poby's nix-darwin setup
|
|
||
|---|---|---|
| .codex/skills/readme | ||
| home | ||
| modules | ||
| secrets | ||
| .gitignore | ||
| .sops.yaml | ||
| AGENTS.md | ||
| flake.lock | ||
| flake.nix | ||
| Justfile | ||
| README.md | ||
nix-darwin
Declarative macOS setup for host fenrir using nix-darwin, home-manager,
nix-homebrew, and sops-nix.
What This Repo Manages
- System-level macOS configuration (
modules/) - User-level tooling and shell/editor setup (
home/) - Declarative Homebrew taps/apps/casks
- Encrypted secrets via SOPS (
secrets/+.sops.yaml)
Prerequisites
- macOS on Apple Silicon (
aarch64-darwin) - Nix with flakes (
nix-command+flakes) just(command runner)- SOPS age key at:
~/.config/sops/age/keys.txt
Repository Layout
flake.nix: flake inputs/outputs anddarwinConfigurationsJustfile: daily commands (darwin,darwin-debug,fmt,up,gc, etc.)modules/: system modules (nix-core.nix,system.nix,apps.nix,host-users.nix)home/: Home Manager modules (shell, git, nvf, terminal, tools)secrets/: encrypted secret files (poby.yaml)
Common Commands
# List available tasks
just
# Build and switch for a host
just darwin $(hostname)
# Build and switch with full trace
just darwin-debug $(hostname)
# Format Nix files (example: whole repo)
just fmt .
# Update all flake inputs
just up
# Update one input
just upp nixpkgs-darwin
# Inspect system profile history
just history
# Clean old generations / garbage collect
just clean
just gc
Secrets
- Secrets are encrypted in
secrets/*.yaml. .sops.yamlenforces age-based encryption rules.- Home Manager reads secrets from
secrets/poby.yamland exposes:github_ssh_keygithub_cli_token
Customization Notes
- Update
hostname,username, anduseremailinflake.nixfor your machine. - Add new system behavior in
modules/*.nix. - Add user tooling in
home/*.nixand import it fromhome/default.nix.
Troubleshooting
- Use
just darwin-debug <hostname>for verbose evaluation/build output. - If a build succeeds but behavior is stale, re-run switch and verify active host/config values.