Skip to content

Repository files navigation

UnstoppableMango's dotfiles

CI Last commit License: MIT Nix flake

Nix has consumed my dotfiles. main is not stable, my NixOS system configurations live over at UnstoppableMango/nixos.

This repo manages my Home Manager config with flake-parts, using the "Dendritic Pattern": modules are grouped by category (browsers, editors, shells, ...) rather than by machine.

Home configurations

Configuration System
erik@darter x86_64-linux
erik@hades x86_64-linux
erik@server x86_64-linux
generic@x86_64-linux x86_64-linux
generic@aarch64-darwin aarch64-darwin

No machine is named server; that entry exists so the headless host file is covered by nix flake check. Neither is any machine or person named generic. Those two build most of the modules with no identity attached, so the export below stays working for somebody who is not me instead of only breaking in their flake.

erik@darter and erik@hades are both standalone Home Manager installs, switched with make home. Hades is also a NixOS machine, so its system half comes from the nixos repo via make system; that repo takes only overlays.default and the dev shell from here.

Layout

  • modules/ - option-driven software config, no identity
  • home/ - my identity and taste (including the account), consuming those options
  • hosts/ - one file per home configuration: which modules it turns on, plus what is true of it alone; common.nix is what all of them are built on

modules/ is flat: one directory per piece of software, each with a default.nix, imported by existing rather than by being listed.

  • ai/ - Claude Code, GitHub Copilot CLI, Cursor CLI, and the per-service MCP toggles
  • brave/, obsidian/ - browser and notes
  • vscode/, neovim/ (nixvim), zed/, helix/, emacs/ - editors
  • kitty/, ghostty/ - terminals
  • zsh/ - Prezto and Powerlevel10k, or oh-my-zsh via dotfiles.zsh.ohMyZsh.enable
  • git/, gnupg/, onepassword/, sops/, ssh/ - identity and secret plumbing
  • c/, containers/, dotnet/, go/, javascript/, kubernetes/, nix/, ocaml/, python/, rust/ - language toolchains
  • gnome/, fonts/, stylix/ - desktop, fonts, theming
  • flake-update/, launch-services/ - automation, and macOS Launch Services registration

Every module is off until something sets its dotfiles.<name>.enable, so importing the modules turns nothing on.

Consuming from another flake

The modules carry no identity, so another person can build a home configuration out of them. Add this repo as an input, import homeModules.dotfiles, and turn on the modules you want:

{
  inputs.dotfiles.url = "github:UnstoppableMango/dotfiles";

  outputs =
    { nixpkgs, home-manager, dotfiles, ... }@inputs:
    {
      homeConfigurations."you@yourmachine" = home-manager.lib.homeManagerConfiguration {
        pkgs = nixpkgs.legacyPackages.aarch64-darwin;
        modules = [
          # `pkgs.gossamer` is referenced by modules/zed and the nixvim
          # config, so the overlay is not optional.
          {
            nixpkgs.overlays = [ dotfiles.overlays.default ];
            nixpkgs.config.allowUnfree = true;
          }

          # These four are what the `dotfiles.*` options build on.
          inputs.stylix.homeModules.stylix
          inputs.nixvim.homeModules.nixvim
          inputs.sops-nix.homeManagerModules.sops
          inputs.nix2git.homeModules.nix2git

          # Every `dotfiles.*` option, plus tdl's `programs.tdl.*`.
          dotfiles.homeModules.dotfiles

          {
            home.username = "you";
            home.homeDirectory = "/Users/you";
            home.stateVersion = "25.05";

            dotfiles = {
              git.enable = true;
              zsh.enable = true;
              neovim.enable = true;
            };
          }
        ];
      };
    };
}

Everything under home/ and hosts/ is my identity and my machines; it is not exported and not meant to be consumed.

Defaults that are mine rather than everyone's, and that you will probably want to override:

Option Default
dotfiles.ssh.hosts {}, fed inputs.hosts.lib.addresses here
dotfiles.ssh.hostKeyAliasDomain thecluster.io
dotfiles.ssh.certAuthorities the clan SSH CA public key
dotfiles.kubernetes.rosequartz.* my cluster's VIP, CA, and OIDC issuer
dotfiles.neovim.defaultConfig true, the bundled nixvim config
dotfiles.zsh.p10kConfig the bundled .p10k.zsh
dotfiles.zed.extensions the bundled extension list
dotfiles.ai.checkoutRoot.context the bundled ~/src checkout-root doc
programs.kitty.settings my fonts, layout, and background
programs.k9s.settings.k9s.ui.skin pink
programs.zed-editor.userSettings Copilot on, telemetry metrics off

The omnigent OpenRouter provider turns on when dotfiles.ai.omnigent.openRouter.apiKeySecret names a sops.secrets entry, and stays off otherwise.

Development

make targets save some typing:

$ make check   # nix flake check
$ make build   # home-manager build --flake $PWD
$ make fmt     # nix fmt (nixfmt + prettier via treefmt)
$ make watch   # rerun `nix flake check` on file changes
$ make update  # nix flake update
$ make home    # update + switch ~/.config/home-manager
$ make system  # update + rebuild /etc/nixos (needs sudo)

Note: make build validates the local flake ($PWD); make home operates on the installed config at ~/.config/home-manager.

Overridable variables: NIX, HOMEMANAGER, WATCHEXEC (all have defaults).

CI runs nix flake check --all-systems, then builds the erik@darter home configuration, using the unstoppablemango Cachix cache.

References and Links

Dendritic Pattern

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages