# psunanand/dotfiles architecture

> Architecture diagram of the GitHub repository psunanand/dotfiles, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/psunanand/dotfiles
- Repository: https://github.com/psunanand/dotfiles

## Overview

This repository defines a macOS environment: Nix flakes and nix-darwin describe the machine, Home Manager manages user packages and links, and native app configuration remains in its own formats. The documented user workflow is to activate the host configuration, which applies system and home settings. The README supports the ownership and configuration relationships shown; source excerpts were unavailable, so internal call-level wiring is not inferred.

Main entry points: [`modules/darwin/default.nix`](https://github.com/psunanand/dotfiles/blob/main/modules/darwin/default.nix) (Darwin modules), [`modules/home/default.nix`](https://github.com/psunanand/dotfiles/blob/main/modules/home/default.nix) (Home modules), [`modules/home/files.nix`](https://github.com/psunanand/dotfiles/blob/main/modules/home/files.nix) (Home file links), [`flake.nix`](https://github.com/psunanand/dotfiles/blob/main/flake.nix) (Flake inputs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Host configuration"]
  node_flake["Flake inputs<br/>[flake.nix]"]
  node_host["mksmbp host<br/>[default.nix]"]
end

subgraph group_system["System configuration"]
  node_darwin["Darwin modules<br/>[default.nix]"]
  node_hm_integration["Home Manager integration<br/>[home-manager.nix]"]
  node_brew["Homebrew inventory<br/>[homebrew.nix]"]
  node_macos["macOS defaults<br/>[macos-defaults.nix]"]
  node_wallpapers["Wallpapers"]
  node_security["Security settings<br/>[security.nix]"]
end

subgraph group_user["Home environment"]
  node_home_modules["Home modules<br/>[default.nix]"]
  node_packages["CLI packages<br/>[packages.nix]"]
  node_programs["Managed programs<br/>[programs.nix]"]
  node_file_links["Home file links<br/>[files.nix]"]
end

subgraph group_native["Native app settings"]
  node_xdg_config["XDG app configs<br/>[.config]"]
  node_home_config["Home-root configs"]
  node_sketchybar["SketchyBar setup<br/>[sketchybar]"]
end

node_user_actor(("Mac owner"))
node_macos_system["macOS"]
node_homebrew_runtime["Homebrew"]

node_user_actor -->|"activates"| node_flake
node_flake -->|"pins configuration"| node_host
node_host -->|"configures system"| node_darwin
node_darwin -->|"integrates"| node_hm_integration
node_darwin -->|"declares inventory"| node_brew
node_darwin -->|"sets defaults"| node_macos
node_macos -->|"sets wallpaper"| node_wallpapers
node_darwin -->|"sets security"| node_security
node_hm_integration -->|"integrates"| node_home_modules
node_home_modules -->|"declares packages"| node_packages
node_home_modules -->|"configures programs"| node_programs
node_home_modules -->|"manages links"| node_file_links
node_file_links -->|"links sources"| node_xdg_config
node_file_links -->|"links sources"| node_home_config
node_brew -->|"manages apps"| node_homebrew_runtime
node_xdg_config -->|"includes settings"| node_sketchybar
node_darwin -->|"activates on"| node_macos_system

click node_flake "https://github.com/psunanand/dotfiles/blob/main/flake.nix"
click node_host "https://github.com/psunanand/dotfiles/blob/main/hosts/mksmbp/default.nix"
click node_darwin "https://github.com/psunanand/dotfiles/blob/main/modules/darwin/default.nix"
click node_hm_integration "https://github.com/psunanand/dotfiles/blob/main/modules/darwin/home-manager.nix"
click node_brew "https://github.com/psunanand/dotfiles/blob/main/modules/darwin/homebrew.nix"
click node_macos "https://github.com/psunanand/dotfiles/blob/main/modules/darwin/macos-defaults.nix"
click node_wallpapers "https://github.com/psunanand/dotfiles/tree/main/wallpapers"
click node_security "https://github.com/psunanand/dotfiles/blob/main/modules/darwin/security.nix"
click node_home_modules "https://github.com/psunanand/dotfiles/blob/main/modules/home/default.nix"
click node_packages "https://github.com/psunanand/dotfiles/blob/main/modules/home/packages.nix"
click node_programs "https://github.com/psunanand/dotfiles/blob/main/modules/home/programs.nix"
click node_file_links "https://github.com/psunanand/dotfiles/blob/main/modules/home/files.nix"
click node_xdg_config "https://github.com/psunanand/dotfiles/tree/main/.config"
click node_home_config "https://github.com/psunanand/dotfiles/tree/main/home"
click node_sketchybar "https://github.com/psunanand/dotfiles/tree/main/.config/sketchybar"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_flake,node_host toneBlue
class node_darwin,node_hm_integration,node_brew,node_macos,node_wallpapers,node_security toneAmber
class node_home_modules,node_packages,node_programs,node_file_links toneMint
class node_xdg_config,node_home_config,node_sketchybar toneRose
class node_user_actor,node_macos_system,node_homebrew_runtime toneIndigo
```

## Components

### Host configuration

- [Flake inputs](https://github.com/psunanand/dotfiles/blob/main/flake.nix): `flake.nix`
- [mksmbp host](https://github.com/psunanand/dotfiles/blob/main/hosts/mksmbp/default.nix): `hosts/mksmbp/default.nix`

### System configuration

- [Darwin modules](https://github.com/psunanand/dotfiles/blob/main/modules/darwin/default.nix): `modules/darwin/default.nix`
- [Home Manager integration](https://github.com/psunanand/dotfiles/blob/main/modules/darwin/home-manager.nix): `modules/darwin/home-manager.nix`
- [Homebrew inventory](https://github.com/psunanand/dotfiles/blob/main/modules/darwin/homebrew.nix): `modules/darwin/homebrew.nix`
- [macOS defaults](https://github.com/psunanand/dotfiles/blob/main/modules/darwin/macos-defaults.nix): `modules/darwin/macos-defaults.nix`
- [Wallpapers](https://github.com/psunanand/dotfiles/tree/main/wallpapers): `wallpapers`
- [Security settings](https://github.com/psunanand/dotfiles/blob/main/modules/darwin/security.nix): `modules/darwin/security.nix`

### Home environment

- [Home modules](https://github.com/psunanand/dotfiles/blob/main/modules/home/default.nix): `modules/home/default.nix`
- [CLI packages](https://github.com/psunanand/dotfiles/blob/main/modules/home/packages.nix): `modules/home/packages.nix`
- [Managed programs](https://github.com/psunanand/dotfiles/blob/main/modules/home/programs.nix): `modules/home/programs.nix`
- [Home file links](https://github.com/psunanand/dotfiles/blob/main/modules/home/files.nix): `modules/home/files.nix`

### Native app settings

- [XDG app configs](https://github.com/psunanand/dotfiles/tree/main/.config): `.config`
- [Home-root configs](https://github.com/psunanand/dotfiles/tree/main/home): `home`
- [SketchyBar setup](https://github.com/psunanand/dotfiles/tree/main/.config/sketchybar): `.config/sketchybar`

### Other components

- **Mac owner**
- **macOS**
- **Homebrew**

## Connections

- Mac owner → Flake inputs: activates
- Flake inputs → mksmbp host: pins configuration
- mksmbp host → Darwin modules: configures system
- Darwin modules → Home Manager integration: integrates
- Darwin modules → Homebrew inventory: declares inventory
- Darwin modules → macOS defaults: sets defaults
- macOS defaults → Wallpapers: sets wallpaper
- Darwin modules → Security settings: sets security
- Home Manager integration → Home modules: integrates
- Home modules → CLI packages: declares packages
- Home modules → Managed programs: configures programs
- Home modules → Home file links: manages links
- Home file links → XDG app configs: links sources
- Home file links → Home-root configs: links sources
- Homebrew inventory → Homebrew: manages apps
- XDG app configs → SketchyBar setup: includes settings
- Darwin modules → macOS: activates on
