Files
nixfiles/system/machine/Darwin/configuration.nix
T
Emma Thorpe e67bc0f4d5 feat(darwin): wire nix-homebrew and make Homebrew authoritative
Add the nix-homebrew input and darwin module so the Homebrew prefix is installed and owned declaratively (no manual bootstrap), with enableRosetta for x86_64 formulae on Apple Silicon and user = host username.

Set homebrew.onActivation.cleanup = zap so the taps/brews/casks/masApps lists are authoritative: anything not declared is removed on activation.
2026-06-02 16:10:16 +00:00

41 lines
1.2 KiB
Nix

# Default nix-darwin host. Minimal macOS baseline; the user environment
# (shell, git, editor) is carried by the shared ./lyrathorpe/home modules,
# the same ones used by the Linux hosts. nixpkgs.hostPlatform is set by
# mkDarwinHost in flake.nix.
{ pkgs, username, ... }:
{
programs.zsh.enable = true;
environment.systemPackages = [ pkgs.git ];
# Account that runs user-level activation and Homebrew.
system.primaryUser = username;
# nix-homebrew owns and installs the Homebrew prefix declaratively, so brew
# itself no longer needs a manual bootstrap. enableRosetta permits x86_64
# formulae via Rosetta 2 on Apple Silicon.
nix-homebrew = {
enable = true;
enableRosetta = true;
user = username;
};
# Declarative Homebrew for packages with no nixpkgs equivalent or that must be
# the vendor build (GUI casks, Mac App Store apps).
homebrew = {
enable = true;
onActivation = {
autoUpdate = true;
upgrade = true;
# Lists below are authoritative: anything not declared is uninstalled.
cleanup = "zap";
};
taps = [ ];
brews = [ ];
casks = [ ];
masApps = { };
};
# Used for backwards compatibility; read `darwin-rebuild changelog` before changing.
system.stateVersion = 5;
}