Skip to content

Commit

Permalink
feat(nix): install homebrew with nix-homebrew
Browse files Browse the repository at this point in the history
  • Loading branch information
WilliamHsieh committed Oct 9, 2024
1 parent 61eece6 commit 4a49302
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 1 deletion.
76 changes: 76 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@
inputs.nixpkgs.follows = "nixpkgs";
};

homebrew = {
url = "github:zhaofengli/nix-homebrew";
inputs.nixpkgs.follows = "nixpkgs";
inputs.nix-darwin.follows = "darwin";
};

git-hooks = {
url = "github:cachix/git-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs";
Expand Down
4 changes: 3 additions & 1 deletion lib/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ in
};
home-manager.users.${dotfiles.home.username} = import hmConfig;
}
];
] ++ (pkgs.lib.optionals pkgs.stdenv.isDarwin [
inputs.homebrew.darwinModules.nix-homebrew
]);
};
};
}
7 changes: 7 additions & 0 deletions system/darwin/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ in
# for login shell
programs.zsh.enable = true; # default shell on catalina

nix-homebrew = {
enable = true;
enableRosetta = pkgs.stdenv.hostPlatform.isAarch64;
user = dotfiles.home.username;
autoMigrate = true;
};

homebrew = {
enable = true;
casks = [
Expand Down

0 comments on commit 4a49302

Please sign in to comment.