Skip to content

torgeir/nix-darwin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nix-darwin

Nix-darwin setup for an M3 mac, a variant of nix for macs.

first time setup

nix --extra-experimental-features 'nix-command flakes' \
  run nix-darwin -- switch --flake ~/.config/nix-darwin

build the system and switch to it

darwin-rebuild switch --flake ~/.config/nix-darwin

(needs root)

repo contents

a few nice things

pkgs, overlays, overrides++

input flakes

aka dependencies

overlays

aka nix package extensions or modifications

updating

you can bump all inputs/dependencies, which updates the flake.lock, with

nix flake update

you can bump a single input, e.g. nixpkgs-firefox-darwin, with

nix flake lock --update-input nixpkgs-firefox-darwin

remember to darwin-rebuild switch afterwards

clean up leftover applications

when you recreate your system for the millionth time, you might end up with multiple applications that no longer represent what your config means should be the current one, meaning commands like open -a <app name> and “Open With” might open apps you no longer mean to have installed

you can see all these generations of systems with

darwin-rebuild --list-generations

you can find out what is keeping built derivations alive by looking up their path in the nix store

nix-store --query --roots /nix/store/...

you can clean up leftover generations older than 7 days with

nix-collect-garbage --delete-older-than 7d
sudo nix-collect-garbage --delete-older-than 7d

you can clean up all leftover generations with

nix-collect-garbage -d
sudo nix-collect-garbage -d

About

A nix-darwin developer setup for an M3 mac

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages