Skip to content

Latest commit

 

History

41 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nixos-config

Prerequisites

  • Nix (install through Determinate Systems) with flakes enabled
  • macOS on Apple Silicon (aarch64-darwin)

Normal workflow

After editing configuration under hosts/, modules/, or overlays/:

  1. Build and switch (most common):

    nix run .#build-switch
  2. Build only (validate changes without activating):

    nix run .#build

    This compiles the system closure and removes the ./result symlink when done. Nothing is activated.

Update inputs

Flake inputs (nixpkgs, darwin, home-manager, Homebrew taps, etc.) are pinned in flake.lock. To refresh them:

# Update all inputs
nix flake update

After updating, rebuild and switch. Review flake.lock changes before committing if you track this repo in git.

Rollback

List available system generations:

sudo darwin-rebuild --list-generations

Roll back interactively (prompts for a generation number):

nix run .#rollback

Cleanup

Remove system generations older than 7 days and collect unreachable store paths:

nix run .#clean

Home Manager and nix-darwin keep their own generation history; darwin-rebuild --list-generations shows system-level generations.

Pragmatic Nix

Although declarative nix is great, there are few things that are not managed through nix:

  • cursor agent cli
  • GitHub Desktop
  • mise global config (e.g., output of mise use --global)
  • AstroNvim's plugins (see "Neovim (AstroNvim)" below)
  • Enabling the 1Password SSH Agent (Settings > Developer > "Use the SSH Agent" in the 1Password app), required once per machine for SSH-based git commit signing (see modules/shared/home-manager.nix)

Neovim (AstroNvim)

AstroNvim is installed as a set of dotfiles rather than a Nix package, since it's fundamentally a Lua config that expects to manage its own plugins. Nix and AstroNvim's own tooling split responsibilities:

  • Nix-managed:
  • Left to AstroNvim's own tooling (pragmatic, not nix-managed):
    • lazy.nvim installs AstroNvim core and all plugins by cloning them from git on first launch, and mason.nvim installs LSPs/formatters/DAPs on demand (:LspInstall, :MasonInstall). Reimplementing this in Nix (e.g. via lazy-nix-helper.nvim) was considered and skipped as unnecessary overhead for this setup.
    • Because ~/.config/nvim is a read-only symlink into the nix store, lazy.nvim's lockfile is redirected to the (writable, non-nix-managed) state dir in lua/lazy_setup.lua (vim.fn.stdpath("state") .. "/lazy-lock.json") instead of its usual home inside the config directory.

To pin plugin versions across machines (the non-Nix equivalent of flake.lock), copy the generated lockfile into the repo and commit it:

cp ~/.local/state/nvim/lazy-lock.json modules/shared/config/nvim/lazy-lock.json

To change the config itself, edit files under modules/shared/config/nvim/ (not the symlinked ~/.config/nvim path directly) and run nix run .#build-switch.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages