No description
  • Nix 90.1%
  • C 9.9%
Find a file
2026-09-30 22:18:41 +02:00
modules fix: name 2026-09-30 22:18:41 +02:00
.gitattributes Exclude dotconfig from GitHub language stats 2026-09-30 08:32:21 +02:00
.gitignore Update .gitignore 2026-09-30 08:32:15 +02:00
flake.lock chore: update flake.lock 2026-09-30 14:12:02 +02:00
flake.nix chore: remove stale todo 2026-09-30 08:32:53 +02:00
README.md feat: name the darwin configuration after the hostname so darwin-rebuild needs no --flake 2026-09-30 08:32:52 +02:00
users.nix feat: git.steenblik.ch for all users 2026-09-30 08:32:53 +02:00

nix-darwin flake

first run on computer

the repo lives in /etc/nix-darwin and every user works in it directly, sharing the same jj/git working copy. safe.directory for this path is set for every user in modules/home-manager/git.nix.

  • install nix (this is the lix installer but it's recommended by nix as it has an uninstaller)
  • clone the repo into /etc and give the staff group write access to it:
# /etc is owned by root, so the empty target has to exist before cloning into it
sudo mkdir /etc/nix-darwin
sudo chown jblik:staff /etc/nix-darwin
# inherited, so every file git and jj create is group writable regardless of each user's umask
chmod +a "group:staff allow list,add_file,search,add_subdirectory,delete_child,readattr,writeattr,readextattr,writeextattr,readsecurity,file_inherit,directory_inherit" /etc/nix-darwin

cd /etc && git clone ssh://git@codeberg.org/jblik/nix-darwin.git
git -C /etc/nix-darwin config core.sharedRepository group
  • sudo scutil --set LocalHostName Jacobs-MacBook-Pro if the hostname differs, as darwin-rebuild builds the configuration named after it
  • sudo nix run nix-darwin/nix-darwin-26.05#darwin-rebuild -- switch (installs darwin-rebuild, afterwards sudo darwin-rebuild switch is enough)
  • jj git init in /etc/nix-darwin to colocate jj with the git repo (jj is installed by the rebuild)

once it's installed

from any path you can run:

  • nix-rebuild which will rebuild configuration (darwin-rebuild switch)
  • nix-update which will perform a flake update and a brew upgrade then rebuild
  • nix-gc {days:30} which performs garbage collection and store optimization
  • nix-update-gc performs nix-update && nix-gc