From 226b8bd10dd806ea67d012544cc014fee04c08d4 Mon Sep 17 00:00:00 2001 From: Dennis Date: Mon, 4 Aug 2025 21:50:57 +0200 Subject: [PATCH] adds nix-homebrew --- flake.lock | 36 ++++++++++++++++++++++++++++++++++++ flake.nix | 7 ++++++- hosts/dnsc-air/default.nix | 7 +++++++ 3 files changed, 49 insertions(+), 1 deletion(-) diff --git a/flake.lock b/flake.lock index 6db1ce6..dec9c92 100644 --- a/flake.lock +++ b/flake.lock @@ -21,6 +21,23 @@ "type": "github" } }, + "brew-src": { + "flake": false, + "locked": { + "lastModified": 1753461463, + "narHash": "sha256-kGc7pRH0diLzKmOHsEFA8sZ9NJpgT+tqxAMsuqNd5Po=", + "owner": "Homebrew", + "repo": "brew", + "rev": "4d14be89e99a45181c18e96a5f19a5b43343cc0f", + "type": "github" + }, + "original": { + "owner": "Homebrew", + "ref": "4.5.13", + "repo": "brew", + "type": "github" + } + }, "darwin": { "inputs": { "nixpkgs": [ @@ -123,6 +140,24 @@ "type": "github" } }, + "nix-homebrew": { + "inputs": { + "brew-src": "brew-src" + }, + "locked": { + "lastModified": 1754250993, + "narHash": "sha256-MEin+qoQKtFC1b0f4tnQ+Z82BQWSCgh6Ef7rpmH9gig=", + "owner": "zhaofengli", + "repo": "nix-homebrew", + "rev": "314d057294e79bc2596972126b84c6f9f144499a", + "type": "github" + }, + "original": { + "owner": "zhaofengli", + "repo": "nix-homebrew", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1745391562, @@ -173,6 +208,7 @@ "home-manager": "home-manager_2", "ip-whitelist": "ip-whitelist", "nix-darwin": "nix-darwin", + "nix-homebrew": "nix-homebrew", "nixpkgs": "nixpkgs_3" } }, diff --git a/flake.nix b/flake.nix index c09dc80..50d2eb8 100644 --- a/flake.nix +++ b/flake.nix @@ -11,6 +11,7 @@ nix-darwin.url = "github:LnL7/nix-darwin/master"; nix-darwin.inputs.nixpkgs.follows = "nixpkgs"; ip-whitelist.url = "github:Oak-Digital/nixos-ip-whitelist-firewall"; + nix-homebrew.url = "github:zhaofengli/nix-homebrew"; }; outputs = @@ -19,6 +20,7 @@ nixpkgs, home-manager, nix-darwin, + nix-homebrew, agenix, ... }@inputs: @@ -47,7 +49,10 @@ darwinConfigurations.dnsc-air = nix-darwin.lib.darwinSystem { system = "aarch64-darwin"; specialArgs = { inherit inputs outputs; }; - modules = [ ./hosts/dnsc-air ]; + modules = [ + nix-homebrew.darwinModules.nix-homebrew + ./hosts/dnsc-air + ]; }; darwinConfigurations.dnsc-work = nix-darwin.lib.darwinSystem { diff --git a/hosts/dnsc-air/default.nix b/hosts/dnsc-air/default.nix index d0687d2..0e1831f 100644 --- a/hosts/dnsc-air/default.nix +++ b/hosts/dnsc-air/default.nix @@ -64,6 +64,13 @@ ]; # Homebrew + nix-homebrew = { + enable = true; + # enableRosetta = true; + user = "dennis"; + autoMigrate = true; + }; + homebrew = { user = "dennis"; enable = true;