diff --git a/flake.lock b/flake.lock index 17665ae..af0f70c 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,88 @@ { "nodes": { + "brew-src": { + "flake": false, + "locked": { + "lastModified": 1731323744, + "narHash": "sha256-SxUQm4cTHcaoPQHoXe26ZV8cZiMWBGow8MjE4L+MckM=", + "owner": "Homebrew", + "repo": "brew", + "rev": "254bf3fe9d8fa2e1b2fb55dbcf535b2d870180c4", + "type": "github" + }, + "original": { + "owner": "Homebrew", + "ref": "4.4.5", + "repo": "brew", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "homebrew-bundle": { + "flake": false, + "locked": { + "lastModified": 1735922156, + "narHash": "sha256-tOoJZFO27K73tdSe7sSBifXnZY7qcFOrfD4HcqBzmek=", + "owner": "homebrew", + "repo": "homebrew-bundle", + "rev": "93317652a34feaed7d8d4bfc52b9ac2de68c5cd1", + "type": "github" + }, + "original": { + "owner": "homebrew", + "repo": "homebrew-bundle", + "type": "github" + } + }, + "homebrew-cask": { + "flake": false, + "locked": { + "lastModified": 1735966291, + "narHash": "sha256-mEdbo+3lH1D008ERQauBQuTMBX+OeHB2rKaR/o1aaho=", + "owner": "homebrew", + "repo": "homebrew-cask", + "rev": "d0ded10395bb5fd28a0a495e26f1939c325d8c3d", + "type": "github" + }, + "original": { + "owner": "homebrew", + "repo": "homebrew-cask", + "type": "github" + } + }, + "homebrew-core": { + "flake": false, + "locked": { + "lastModified": 1735965348, + "narHash": "sha256-o2uC6uH/AgUhyXF3lLAh0a5bw/SiRzdWUnwx2TKGubQ=", + "owner": "homebrew", + "repo": "homebrew-core", + "rev": "a24fc02cb17b0d67657b6e707669a29578e2c9f2", + "type": "github" + }, + "original": { + "owner": "homebrew", + "repo": "homebrew-core", + "type": "github" + } + }, "nix-darwin": { "inputs": { "nixpkgs": [ @@ -20,7 +103,75 @@ "type": "github" } }, + "nix-darwin_2": { + "inputs": { + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1716329735, + "narHash": "sha256-ap51w+VqG21vuzyQ04WrhI2YbWHd3UGz0e7dc/QQmoA=", + "owner": "LnL7", + "repo": "nix-darwin", + "rev": "eac4f25028c1975a939c8f8fba95c12f8a25e01c", + "type": "github" + }, + "original": { + "owner": "LnL7", + "repo": "nix-darwin", + "type": "github" + } + }, + "nix-homebrew": { + "inputs": { + "brew-src": "brew-src", + "flake-utils": "flake-utils", + "nix-darwin": "nix-darwin_2", + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1732145543, + "narHash": "sha256-VRQh/lvCSko9YV7haXyPt7DSp+EkgjjBv/9U4cY9c50=", + "owner": "zhaofengli-wip", + "repo": "nix-homebrew", + "rev": "ac3945ee614f69ab89c6935b3f0567028de5f012", + "type": "github" + }, + "original": { + "owner": "zhaofengli-wip", + "repo": "nix-homebrew", + "type": "github" + } + }, "nixpkgs": { + "locked": { + "lastModified": 1687274257, + "narHash": "sha256-TutzPriQcZ8FghDhEolnHcYU2oHIG5XWF+/SUBNnAOE=", + "path": "/nix/store/22qgs3skscd9bmrxv9xv4q5d4wwm5ppx-source", + "rev": "2c9ecd1f0400076a4d6b2193ad468ff0a7e7fdc5", + "type": "path" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1716330097, + "narHash": "sha256-8BO3B7e3BiyIDsaKA0tY8O88rClYRTjvAp66y+VBUeU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "5710852ba686cc1fd0d3b8e22b3117d43ba374c2", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { "locked": { "lastModified": 1735821806, "narHash": "sha256-cuNapx/uQeCgeuhUhdck3JKbgpsml259sjUQnWM7zW8=", @@ -38,8 +189,27 @@ }, "root": { "inputs": { + "homebrew-bundle": "homebrew-bundle", + "homebrew-cask": "homebrew-cask", + "homebrew-core": "homebrew-core", "nix-darwin": "nix-darwin", - "nixpkgs": "nixpkgs" + "nix-homebrew": "nix-homebrew", + "nixpkgs": "nixpkgs_3" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" } } }, diff --git a/flake.nix b/flake.nix index 9aadbc4..2ca8df6 100644 --- a/flake.nix +++ b/flake.nix @@ -5,11 +5,24 @@ nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; nix-darwin.url = "github:LnL7/nix-darwin"; nix-darwin.inputs.nixpkgs.follows = "nixpkgs"; - # home-manager.url = "github:nix-community/home-manager"; - # home-manager.inputs.nixpkgs.follows = "nixpkgs"; + nix-homebrew.url = "github:zhaofengli-wip/nix-homebrew"; + + # Optional: Declarative tap management + homebrew-core = { + url = "github:homebrew/homebrew-core"; + flake = false; + }; + homebrew-cask = { + url = "github:homebrew/homebrew-cask"; + flake = false; + }; + homebrew-bundle = { + url = "github:homebrew/homebrew-bundle"; + flake = false; + }; }; - outputs = inputs@{ self, nix-darwin, nixpkgs }: + outputs = inputs@{ self, nix-darwin, nix-homebrew, homebrew-core, homebrew-cask, homebrew-bundle, ... }: let configuration = { pkgs, lib, inputs, ... }: { # List packages installed in system profile. To search by name, run: @@ -18,7 +31,7 @@ [ pkgs.vim ]; - + nix.extraOptions = '' extra-platforms = x86_64-darwin aarch64-darwin ''; @@ -28,8 +41,13 @@ tailscale = { enable = true; }; + spotifyd = { + enable = true; + }; }; + # homebrew.nix = true; + # Enable the darwin security.pam module for sudo Touch ID authentication. security = { pam = { @@ -84,20 +102,6 @@ nixpkgs.config = { allowUnfree = true; allowBroken = true; - # homebrew = { - # enable = true; - # packages = with pkgs; [ - # # homebrew packages - # "1password-cli" - # "1password" - # ]; - # }; - # allowAliases = true; - # packageOverrides = pkgs: { - # # Add a package to the set. - # _1password-cli = pkgs.callPackage ./pkgs/1password-cli { }; - # _1password-gui = pkgs.callPackage ./pkgs/1password-gui { }; - # }; }; }; in @@ -107,7 +111,22 @@ darwinConfigurations."swaphb-mba" = nix-darwin.lib.darwinSystem { modules = [ configuration - ]; + nix-homebrew.darwinModules.nix-homebrew + { + nix-homebrew = { + enable = true; + enableRosetta = true; + user = "stephen"; + taps = { + "homebrew/homebrew-core" = homebrew-core; + "homebrew/homebrew-cask" = homebrew-cask; + "homebrew/homebrew-bundle" = homebrew-bundle; + }; + autoMigrate = true; + mutableTaps = false; + }; + } + ]; }; # Expose the package set, including overlays, for convenience.