A single Nix flake managing both macOS (via nix-darwin) and NixOS from one repository. Declarative, reproducible system configurations for every machine.
- Single flake, multiple systems — macOS and NixOS hosts share inputs, overlays, and Home Manager modules.
- macOS support —
nix-darwinsystem configuration with Homebrew integration vianix-homebrew. - NixOS + ZFS —
chopperlaptop runs NixOS with ZFS root provisioned by disko. - Home Manager — per-user environment for both platforms, usable standalone or integrated into the system rebuild.
- Neovim — configured via nixvim.
- Rust toolchain — nightly Rust via fenix.
- Secrets management — sops-nix
is in the flake inputs but not yet wired up. Secrets currently live at
plaintext paths under
/home/vysakh/. - CI —
nix flake checkin GitHub Actions. - treefmt — unified formatting (currently
nixpkgs-fmtvianix fmt).
.
├── flake.nix # Flake entrypoint: inputs, outputs, host configs
├── flake.lock
├── CLAUDE.md # Audit notes & improvement checklist
├── ROADMAP.md # Milestone plan
├── CONTRIBUTING.md # Contributor guide
│
├── hosts/
│ ├── darwin/ # macOS — "Vysakhs-MacBook-Pro"
│ │ ├── configuration.nix # system-level nix-darwin config
│ │ ├── programs.nix # GUI / CLI programs
│ │ ├── services.nix # launchd / background services
│ │ └── NVIM.md # Neovim notes
│ └── chopper/ # NixOS — "chopper" laptop
│ ├── configuration.nix # NixOS entry (imports default.nix)
│ ├── default.nix # bulk of host config
│ ├── disko-config.nix # ZFS partition layout
│ └── hardware-configuration.nix
│
├── home/ # Home Manager configurations
│ ├── darwin-home.nix # HM entry point for macOS
│ ├── linux-home.nix # HM entry point for NixOS
│ ├── common/ # cross-platform HM modules
│ ├── darwin/ # mac-only HM modules
│ └── chopper/ # chopper-only HM modules
│
├── modules/ # NixOS service modules
│ ├── arr.nix # *arr media stack
│ ├── care.nix # care service
│ ├── conduit.nix # Conduit / conduwuit Matrix homeserver
│ ├── garage.nix # Garage S3-compatible storage
│ ├── neondb.nix # NeonDB wrapper
│ ├── nextcloud.nix # Nextcloud server
│ └── zfs.nix # ZFS maintenance / scrub config
│
└── packages/ # Custom packages & overlays
├── default.nix
├── chopper/ # packages for chopper
├── darwin/ # packages for macOS
└── neondb/ # NeonDB derivation
graph TD
F[flake.nix] --> L[lib/default.nix]
F --> DC[darwinConfigurations]
F --> NC[nixosConfigurations]
F --> HC[homeConfigurations]
L --> |mkDarwinHost| DC
L --> |mkHost| NC
L --> |mkHome| HC
L --> |discoverHosts| MD[hosts/*/metadata.nix]
DC --> DH[hosts/darwin/configuration.nix]
DH --> DP[hosts/darwin/programs.nix]
DH --> DS[hosts/darwin/services.nix]
DH --> DB[hosts/darwin/homebrew.nix]
NC --> CH[hosts/chopper/configuration.nix]
CH --> CD[hosts/chopper/default.nix]
CD --> PB[parts/boot.nix]
CD --> PN[parts/network.nix]
CD --> PP[parts/power.nix]
CD --> PD[parts/display.nix]
CD --> PV[parts/virtualisation.nix]
CD --> PPR[parts/programs.nix]
CD --> PU[parts/users.nix]
CD --> PS[parts/services.nix]
CH --> MOD[modules/]
MOD --> MZ[zfs.nix]
MOD --> MN[nextcloud.nix]
MOD --> MC[conduit.nix]
MOD --> MA[arr.nix]
HC --> HDH[home/darwin-home.nix]
HC --> HLH[home/linux-home.nix]
HDH --> HCO[home/common/]
HDH --> HDA[home/darwin/]
HLH --> HCO
HLH --> HCH[home/chopper/]
NC --> PROF[profiles/]
PROF --> PRB[base.nix]
PROF --> PRL[laptop.nix]
PROF --> PRS[server.nix]
PROF --> PRZ[zfs.nix]
PROF --> PRW[wayland.nix]
PROF --> PRD[dev.nix]
| Host | System | Manager | Description |
|---|---|---|---|
Vysakhs-MacBook-Pro |
aarch64-darwin |
nix-darwin | MacBook Pro (Apple Silicon) |
chopper |
x86_64-linux |
NixOS | Laptop, ZFS root via disko |
Home Manager targets:
| Target | Platform |
|---|---|
mathewalex@Vysakhs-MacBook-Pro |
macOS |
vysakh@chopper |
NixOS |
# macOS (nix-darwin)
nh darwin switch .
# NixOS
nh os switch .# macOS
home-manager switch --flake .#mathewalex@Vysakhs-MacBook-Pro
# NixOS
home-manager switch --flake .#vysakh@chopper# Update all flake inputs
nix flake update
# Format nix files
nix fmt
# Search packages
nix search nixpkgs <package-name>
# Check flake evaluation
nix flake check- Add a host — create
hosts/<name>/with aconfiguration.nix(and optionallydefault.nix,hardware-configuration.nix, etc.), then wire it intoflake.nix. SeeCONTRIBUTING.mdfor more detail. - Add a Home Manager module — create a directory under
home/common/(cross-platform) orhome/<host>/(host-specific) with adefault.nix, then import it from the relevant entry point. - Add a NixOS service — create
modules/<service>.nixand import it from the host that needs it. - Add a package — add it under
packages/and expose via the overlay inpackages/default.nix.
| Input | Purpose |
|---|---|
| nixpkgs (unstable) | Package set |
| home-manager | User environment |
| nix-darwin | macOS system config |
| nix-homebrew | Homebrew cask integration |
| fenix | Nightly Rust toolchain |
| nixvim | Neovim configuration |
| disko | Declarative disk partitioning |
| sops-nix | Secrets management (planned) |
| nix-index-database | command-not-found index |
See LICENSE for details.