Skip to content

Latest commit

 

History

History
89 lines (70 loc) · 3.11 KB

README.md

File metadata and controls

89 lines (70 loc) · 3.11 KB

dotfiles 🍩

screenshot

Personal dotfiles, managed in three layers:

  • Nix (nix/): system configuration and packages, pinned by flake.lock and applied with a rebuild. Fully reproducible.
  • Stow (stow/): dotfiles symlinked into $HOME with GNU Stow (not Nix). Changes take effect immediately, no rebuild needed.
  • Kaizen (kaizen/): my custom Linux desktop experience, a Quickshell shell for niri or umbriel.

Convenience links

Quickstart

  1. Install either... a. NixOS, with the user fredrik b. macOS + Homebrew + nix-darwin

  2. Set hostname to a host under nix/hosts/

  3. Clone this repo into ~/.dotfiles; on a fresh NixOS, git comes from nix-shell -p git

  4. NixOS: copy the installer's /etc/nixos/hardware-configuration.nix over nix/hosts/<host>/hardware-configuration.nix, which holds the old install's filesystem UUIDs

  5. Rebuild; a host with a submodule adds ?submodules=1:

    # NixOS
    sudo nixos-rebuild switch --flake ~/.dotfiles#"$(hostname -s)"
    
    # for hosts with private submodules
    sudo nixos-rebuild switch --flake "$HOME/.dotfiles?submodules=1#wily"
    
    # macOS
    sudo darwin-rebuild switch --flake ~/.dotfiles#"$(hostname -s)"

The rebuild stows the dotfiles, so stow.sh needs no separate run. On a machine without Nix, ~/.dotfiles/stow.sh links the dotfiles alone.

Then, after the first rebuild, some common commands:

# rebuild and switch using nh
nh os switch --ask  # NixOS
nh darwin switch --ask  # macOS

# run stowing of files
~/.dotfiles/stow.sh

# update all flake inputs
nix flake update

# update only specific input
nix flake update llm-agents  # example

# clean up old generations
sudo nix-collect-garbage --delete-older-than 5d

# update homebrew packages on macOS
brew update && brew upgrade   # add --greedy to also bump self-updating casks

Note

Pinning Homebrew versions is possible via nix-homebrew with locked taps, but it buys little here: casks that self-update ignore the pin, vendors delete old cask artifacts, and Mac App Store apps cannot be pinned at all.