Skip to content

nobbmaestro/nix-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

688 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

❄️ Nobbmaestro's Nix Config ❄️

macOS Build

A fully declarative macOS development environment built on Nix flakes and nix-darwin. Organised with the dendritic pattern on top of flake-parts and import-tree — drop a .nix file in the right place and it's picked up automatically.

What's included

System (nix-darwin)

Layered under modules/system/darwin/:

  • 0-base — core macOS system setup and app fixes
  • 1-shell — system-level shell configuration
  • 2-tools — system-level CLI tools
  • 3-desktop — desktop settings, fonts, keyboard, security, and macOS defaults

Programs (home-manager)

Per-program modules under modules/programs/:

  • Editor / shell: Neovim, Zsh, Starship, Tmux, Kitty
  • Navigation: fzf, zoxide, yazi, eza
  • Git workflow: Git, LazyGit, LazyDocker
  • Window management: AeroSpace (i3-like tiling WM for macOS)
  • Dev ergonomics: direnv, lazyhis

Package management

Repository layout

flake.nix                     # minimal entry point — imports ./modules via import-tree
modules/
├── nix/                      # flake-parts setup, home-manager & nix-homebrew integration
├── system/darwin/            # nix-darwin system layers (0-base … 3-desktop)
├── programs/                 # per-program home-manager modules
├── users/                    # per-user home-manager configs (norbertbatiuk, work)
└── hosts/                    # per-host darwin configs
    └── macbook-pro-m1/
        ├── configuration.nix # host-level config
        └── users/            # which users live on this host

With the dendritic pattern, every .nix file under modules/ is auto-imported — there is no central import list to maintain. flake.nix simply hands the tree to flake-parts.

Getting started

1. Install nix

Install nix from the official installer:

sh <(curl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install)

or, simply run:

make install

2. Build the system

The following command will build and apply the full macOS configuration using nix-darwin:

make switch

This defaults to the macbook-pro-m1 host (see HNAME in the Makefile) and is equivalent to:

sudo darwin-rebuild switch --flake .#macbook-pro-m1

To target a different host, override HNAME:

make switch HNAME=<hostname>

The hostname must match a host defined under modules/hosts/.

3. Install git hooks

Run once after cloning to install the pre-commit formatter hook:

nix run .#install-hooks

Other useful targets

make check     # nix flake check
make update    # nix flake update
make clean     # nix-store --gc
make uninstall # remove nix-darwin

Adding a host or user

  • New host: create modules/hosts/<hostname>/configuration.nix following the pattern in macbook-pro-m1, then add modules/hosts/<hostname>/users/<user>.nix binding files for each user on that host.
  • New user: create modules/users/<user>/ with the user's home-manager config, then bind it to one or more hosts via the users/<user>.nix files above.

Resources

Final Words

This very repository is intended for my personal usage. Breaking changes, change of utilities, or pattern may occur at any point.

Enjoy!

About

My Personal Nix, NixOS and Nix-Darwin System Configuration Flake

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors