My dotfiles, managed by nix-darwin and home-manager.
Find a file
2025-12-05 20:30:10 +00:00
bin migrate to nix driven approach 2025-10-14 23:01:15 +01:00
go Move asdf sourcing for go into go dir 2025-05-05 14:53:39 +01:00
home-manager podman: add docker.io as default registry 2025-12-05 20:30:10 +00:00
scripts add some install scripts for nix, nix-darwin, and home-manager 2025-10-17 17:32:26 +01:00
shell add jwt decoding function for the cli 2025-11-25 10:46:18 +00:00
.gitignore more clear up 2024-02-26 23:13:39 +00:00
flake.lock update versions 2025-12-01 21:36:37 +00:00
flake.nix update versions 2025-12-01 21:36:37 +00:00
macos.nix move nix files to the root level 2025-10-17 17:32:26 +01:00
README.md add gc note to readme 2025-10-19 18:18:35 +01:00

Elliot's dot files

A Nix-centric dotfiles configuration that manages system packages and core configurations declaratively, while maintaining flexibility for custom shell functions and scripts.

Structure

The dotfiles are organized around Nix as the primary configuration system, with custom shell scripts for flexibility:

  • nix/: Core system and application configuration using Nix and home-manager
  • shell/: Custom shell functions and completions that extend the base configuration
  • bin/: Executable scripts available in PATH

Core Philosophy

This setup uses Nix where it excels (declarative package and configuration management) while keeping shell functions and scripts flexible for rapid iteration and customization.

What's Inside

Nix Configuration

  • nix/flake.nix: Main flake configuration for macOS and Linux
  • nix/home-manager/: Home Manager configurations for user programs
  • nix/home-manager/programs/: Individual program configurations (git, zsh, tmux)

Shell Extensions

  • shell/functions/: Custom shell functions (git helpers, prompt, window management)
  • shell/completions/: Custom zsh completions
  • bin/: Utility scripts and git helpers

How It Works

Nix Management

Nix handles:

  • Package installation and management
  • Core program configuration (git, zsh, tmux, etc.)
  • Environment variables and shell aliases
  • System-level settings

Shell Function Loading

The zsh configuration automatically loads:

  • All *.zsh files from shell/functions/ as shell functions
  • All *.zsh files from shell/completions/ as completions (after compinit)
  • Scripts from bin/ are automatically added to $PATH

Adding New Functionality

  • Declarative config: Add to appropriate nix/home-manager/programs/*.nix file
  • Shell functions: Create new .zsh files in shell/functions/
  • Completions: Add completion scripts to shell/completions/
  • Executables: Add scripts to bin/

Installation

Prerequisites

  • Install Nix. The recommended path is via the Determinate Systems project "nix installer", although this will soon drop standard nix. There is a fork in the works but it's experimental.

Determinate Systems version - https://github.com/DeterminateSystems/nix-installer Nix fork (experimental) - https://github.com/NixOS/experimental-nix-installer

  • On macOS, install nix-darwin via the nix run command in the nix-darwin installation guide. This will require the dotfiles to be pulled, and you to be in the nix directory.

Setup

# For macos personal machine
sudo darwin-rebuild build --flake .#elliot@macos-personal
sudo darwin-rebuild switch --flake .#elliot@macos-personal

# For macos work machine
sudo darwin-rebuild build --flake .#elliot@macos-work
sudo darwin-rebuild switch --flake .#elliot@macos-work

# On Linux:
home-manager switch --flake .#elliot@hostname

Customization

  • Edit program configurations in nix/home-manager/programs/
  • Add shell functions to shell/functions/
  • Modify the flake.nix for system-level changes
  • Use ~/.localrc and ~/.localaliases for machine-specific overrides

Garbage collection

Nix maintains built profiles pretty much infinitely from what I can tell. So it's useful to clean up every so often to keep disk usage under control.

# Delete all but the 5 most recent profile generations.
# This works on macos, it might work on linux as well.
sudo nix-env --delete-generations +5 --profile /nix/var/nix/profiles/system

Notes

  • asdf is accounted for via shims and functions in the zsh/bash scripts, but it's not encouraged. Most systems managed by these dotfiles don't use them but it's there to support other systems.