Sandbox
@malob/nix-config

Nix dotfiles for macOS, Linux, and Claude Code

This repo defines one person’s Nix-based desktop and terminal setup across macOS and Linux. It also includes Claude Code config, hooks, and shared Nix modules for things like colors, git aliases, and shell setup.

463 stars37 forksPythonUpdated 11d ago
Who it's for

Builders who want to study or copy parts of a personal Nix config for macOS, Linux, or Claude Code.

What it delivers

You can reuse a working Nix dotfiles setup instead of assembling your own from scratch.

What it does

Flake-based Nix configuration

Uses `flake.nix` and `flake.lock` to pin inputs and build system and home configurations.

Darwin and home-manager setups

Splits macOS settings under `darwin/` and user config under `home/`, with shared helpers in `lib/` and `modules/`.

Claude Code configuration

Keeps Claude Code settings in `.claude/`, `CLAUDE.md`, `configs/claude/`, and `home/claude.nix`.

Declarative colors and shell setup

Includes home modules for colors, Fish, Starship, tmux, and app themes like Ghostty, bat, and yazi.

CI for builds and lockfile updates

Uses GitHub Actions under `.github/workflows` to build configs and update flake inputs.

README

My Nix Configs

Build Nix envs

This repo contains my Nix configs for macOS and Linux and by extension, configuration for most tools/programs I use, at least in the terminal.

I'm continuously tweaking/improving my setup, trying to find ways to make more of my configuration declarative, and I like experimenting with bleeding edge updates/features, so this repo sees a lot of changes. I do try to ensure that master always builds and doesn't have any bad bugs (at least in my workflow), and keep the code fairly well documented.

Feel free to file an issue or start a discussion if you find a bug, or think something is broken, or think I'm doing something in a dumb/clumsy way and have a suggestion for a more elegant alternative, or try to crib something from my config but just can't get it working, or are looking at my config and think to yourself "does this guy know about X, cause I bet he'd be into it", or have some other type of feedback/comment. (Issues, are better for things that are actually issues, while discussions are better for ideas, questions, etc.)

I make no promises that I'll respond quickly, or fix the bug (especially if I'm not experiencing it), or whatever, but you definitely shouldn't feel like you're imposing in any way, and I probably will respond within a few days.

Below, I've highlighted stuff that I'm particularly happy with or think others might find helpful/useful.

Highlights

In no particular order:

  • Flakes!
    • All external dependencies managed through flakes for easy updating.
    • Outputs for nix-darwin macOS system configurations (using home-manager as a nix-darwin module) and a home-manager user configuration for Linux.
    • A function to simplify making nix-darwin system configurations (with home-manager integration), lib.mkDarwinSystem.
    • darwinModules output for nix-darwin modules with additional functionality and prepackaged configuration, including:
      • users-primaryUser that provides users.primaryUsers.{username,fullName,email,nixConfigDirectory} options, which allows specifying this information one time by setting these options and then referencing their values when setting other options.
    • homeManagerModules output for home-manager modules with additional functionality and prepackaged configuration, including:
      • home-user-info, that provides the same options as the my nix-darwin module users-primaryUsers above under home.user-info. See examples of it in use in home/git.nix.
      • colors module for declarative colorscheme definitions using OkLCH color math. Schemes define shared monotones and accents; the module auto-generates both light/dark polarities with correct ANSI mapping, bright variants, and per-app themes (Ghostty, Fish, kitty, bat, yazi). See home/colors.nix for usage.
      • malo-git-aliases
      • malo-gh-aliases
      • programs-starship-extras that provides programs.starship.extras.presets.<name> options for easily enabling Starship presets.
    • Support for non-flake compatible versions of Nix and legacy workflows through flake-compat:
      • default.nix, allows traditional Nix commands like nix-build to operate on the flake inputs/outputs.
  • Support for Macs with Apple Silicon including ability to easily overlay in x86 version of packages, when they don't build on ARM. Search pkgs-x86 in flake.nix and see nix.settings.extra-platforms in darwin/bootstrap.nix for details.
  • A GitHub workflow that builds the my macOS system nix-darwin config and home-manager Linux user config, and updates a Cachix cache. Also, once a week it updates all the flake inputs before building, and if the build succeeds, it commits the updated flake.lock file.
  • Git config with a bunch of handy aliases and better diffs using delta.
  • Unified colorscheme (based on OK Solar, itself a perceptually uniform redesign of Solarized) with automatic light/dark switching across Ghostty, Fish, bat, yazi, and other tools. Fish uses its native .theme file format with OSC-based theme switching — no manual toggle needed.
  • A nice shell prompt config for Fish using Starship.
  • Claude Code config with live-editable configuration.
    • Uses 1MCP to aggregate MCP servers via LaunchAgent
    • Symlinks config files to configs/claude/ for editing without rebuild
    • Global context, settings, and permissions managed declaratively

Files in the repo

Repository payload15 top-level entries
  • .claude
  • .github
  • configs
  • darwin
  • home
  • lib
  • modules
  • .gitignore
  • CLAUDE.md
  • default.nix
  • flake.lock
  • flake.nix
  • LICENSE
  • readme.md
  • statix.toml

Discussion (0)

Ask about usage, or say what you built with it

Sign in to join the discussion.

No comments yet. Be the first to say what this is good for.

More other

🎨 Best DeepSeek Harness Design Plugin. The open-source Claude Design alternative. 🖥️ Local-first desktop app. 🖼️ Your coding agent becomes the design engine: prototypes, landing pages, dashboards, slides, images & video — real files, HTML/PDF/PPTX/MP4 export. 🤖 Claude Code / Codex / Cursor / DeepSeek Harness / OpenCode & 20+ CLIs via BYOK.

95k
tinyhumansai/
openhuman

OpenHuman is an open source personal AI for Mac, Windows and Linux — local-first memory, agent orchestration, and deep research.

40k

Your Personal AI Assistant; easy to install, deploy on your own machine or on the cloud; supports multiple chat apps with easily extensible capabilities.

35k

AIPOCH Open-Science is an open-source, local-first, model-agnostic AI research workbench for macOS, Windows, and Linux, with scientific agents, Python/R notebooks, data connectors, and reproducible provenance.

4k

🤯 LobeHub is your Chief Agent Operator, organizing your agents into 7×24 operations by hiring, scheduling, and reporting on your entire AI team.

82k