Start from your Mac
You’ve spent years getting your Mac the way you like it. current reads it back as Nix, in a file you can import as it is.
1. Write your settings down
Section titled “1. Write your settings down”nix run github:sushydev/nix-plist-manager#current -- mac.nix --scope usernix run github:sushydev/nix-plist-manager#current -- mac-system.nix --scope system--scope user is everything home-manager applies, --scope system what nix-darwin applies as root. Import them where they belong:
# home-managerprograms.nix-plist-manager = { enable = true; options = import ./mac.nix;};
# nix-darwinprograms.nix-plist-manager = { enable = true; options = import ./mac-system.nix;};Without a file name it prints to the terminal. Without --scope you get one file with both, as { user = …; system = …; }, for (import ./mac.nix).user.
2. Keep what you care about
Section titled “2. Keep what you care about”Settings still at macOS’s default are left out, so the file is what you changed. The defaults come from deleting each setting and reading what System Settings shows, on the macOS version they were recorded for; settings without a known default are included, so look over the file and delete what you don’t have an opinion about. --all includes the defaults too, but declaring a default pins it: if Apple changes it in a later release, your Mac keeps the old one.
3. Pick up what you change later
Section titled “3. Pick up what you change later”Change something in System Settings, then ask what’s different from your file:
nix run github:sushydev/nix-plist-manager#current -- --scope user --against mac.nix{ applications = { finder = { menuBar = { view = { showPathBar = false; }; }; }; };}Only the settings whose value on your Mac isn’t the one in mac.nix are printed, so you can copy them over.
Options
Section titled “Options”--allincludes the settings at macOS’s default.--only <prefix>reads part of it:--only applications.systemSettings.keyboard.--uireads the settings macOS hasn’t written down yet from System Settings itself. It opens System Settings while it runs; combine it with--onlyto keep that short.--snapshots <directory>also captures the snapshot settings (the Dock’s apps, the menu bar layout, the wallpaper) into that directory.--verboselists the settings that couldn’t be read.