diff --git a/flake.lock b/flake.lock index d1a1cbc..d9a1906 100644 --- a/flake.lock +++ b/flake.lock @@ -256,6 +256,26 @@ "type": "github" } }, + "homebrew": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1785271058, + "narHash": "sha256-xVisL04Gt6LsGa1cGCLHhTED7iEykgl7krPyzAm2ZQg=", + "owner": "koalalorenzo", + "repo": "home-manager-brew", + "rev": "795f9aed8ddce24b3cae3b75598e6861e7d72d10", + "type": "github" + }, + "original": { + "owner": "koalalorenzo", + "repo": "home-manager-brew", + "type": "github" + } + }, "lanzaboote": { "inputs": { "crane": "crane", @@ -551,6 +571,7 @@ "bun2nix": "bun2nix", "claude-code": "claude-code", "home-manager": "home-manager", + "homebrew": "homebrew", "lanzaboote": "lanzaboote", "nix-cachyos-kernel": "nix-cachyos-kernel", "nix-darwin": "nix-darwin", diff --git a/flake.nix b/flake.nix index 91dc15c..73aab28 100644 --- a/flake.nix +++ b/flake.nix @@ -61,6 +61,10 @@ url = "github:nix-darwin/nix-darwin/master"; inputs.nixpkgs.follows = "nixpkgs"; }; + homebrew = { + url = "github:koalalorenzo/home-manager-brew"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = { self, nixos-hardware, nix-darwin, ... }@inputs: @@ -86,8 +90,10 @@ imports = [ ./home-modules ./users/user/home.nix + inputs.homebrew.homeManagerModules.default ]; lumpiastyHome.macos = true; + lumpiastyHome.brew = true; }; nixpkgs.overlays = [ inputs.claude-code.overlays.default diff --git a/home-modules/brew.nix b/home-modules/brew.nix new file mode 100644 index 0000000..64f092f --- /dev/null +++ b/home-modules/brew.nix @@ -0,0 +1,23 @@ +{ config, lib, pkgs, ... }: + +{ + options.lumpiastyHome.brew = lib.mkEnableOption "Homebrew integration via home-manager-brew"; + + config = lib.mkMerge [ + (lib.mkIf config.lumpiastyHome.brew { + homebrew = { + enable = true; + brewInstall = true; + update = true; + upgrade = true; + cleanup = true; + casks = [ + "steam" + ]; + }; + }) + (lib.mkIf (!config.lumpiastyHome.brew) { + homebrew.enable = lib.mkForce false; + }) + ]; +} diff --git a/home-modules/default.nix b/home-modules/default.nix index c28442e..897d8e0 100644 --- a/home-modules/default.nix +++ b/home-modules/default.nix @@ -9,6 +9,7 @@ ./fhsBash.nix ./linux.nix ./macos.nix + ./brew.nix ] ++ lib.optionals (osConfig.lumpiasty.enablePlasma) [ ./plasma.nix ];