From a8acb0900b8c600da4ff1683e4ce558e97463ea7 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Mon, 25 Nov 2024 15:41:54 +0100 Subject: [PATCH] Enable Homebrew for aarch64-darwin Added configuration to enable Homebrew on aarch64-darwin systems. Created a new module for managing Homebrew settings and added support for declarative tap management. --- modules/darwin/system/homebrew/default.nix | 38 ++++++++++++++++++++++ systems/aarch64-darwin/m4/default.nix | 7 ++++ 2 files changed, 45 insertions(+) create mode 100644 modules/darwin/system/homebrew/default.nix diff --git a/modules/darwin/system/homebrew/default.nix b/modules/darwin/system/homebrew/default.nix new file mode 100644 index 0000000..2099b6a --- /dev/null +++ b/modules/darwin/system/homebrew/default.nix @@ -0,0 +1,38 @@ +{ lib, config, inputs, ... }: + +with lib; +with lib.metacfg; +let + cfg = config.metacfg.system.fonts; +in +{ + imports = [ inputs.nix-homebrew.darwinModules.nix-homebrew ]; + + options.metacfg.system.homebrew = with types; { + enable = mkBoolOpt false "Whether or not to enable homebrew"; + }; + config = mkIf cfg.enable { + nix-homebrew = { + # Install Homebrew under the default prefix + enable = true; + + # Apple Silicon Only: Also install Homebrew under the default Intel prefix for Rosetta 2 + enableRosetta = false; + + # User owning the Homebrew prefix + user = "harald"; + + # Optional: Declarative tap management + taps = { + "homebrew/homebrew-core" = inputs.homebrew-core; + "homebrew/homebrew-cask" = inputs.homebrew-cask; + "homebrew/homebrew-bundle" = inputs.homebrew-bundle; + }; + + # Optional: Enable fully-declarative tap management + # + # With mutableTaps disabled, taps can no longer be added imperatively with `brew tap`. + mutableTaps = false; + }; + }; +} diff --git a/systems/aarch64-darwin/m4/default.nix b/systems/aarch64-darwin/m4/default.nix index 5985c8b..db3b0c5 100644 --- a/systems/aarch64-darwin/m4/default.nix +++ b/systems/aarch64-darwin/m4/default.nix @@ -2,7 +2,14 @@ with lib.metacfg; { + + homebrew = { + enable = true; + brews = [ "libusb"]; + }; + metacfg = { + system.homebrew = enabled; suites = { common = enabled; };