dustinlyons / nixos-config

General purpose Nix configuration for macOS / NixOS with starter templates + step-by-step guides ✨
BSD 3-Clause "New" or "Revised" License
1.63k stars 102 forks source link

Issue with Adding Homebrew Tap #38

Closed injae closed 9 months ago

injae commented 10 months ago

Hello, I'm currently trying to install emacs-plus using the Homebrew tap, but it seems that the tap is not functioning properly. Is there any part that I might have set up incorrectly?

Info

Env: M3 Pro Mackbook

Error

nix run .#build-switch

Warning: 'emacs-plus@30' formula is unreadable: No available formula with the name "emacs-plus@30". Installing emacs-plus@30 Warning: 'emacs-plus@30' formula is unreadable: No available formula with the name "emacs-plus@30".

>  /opt/homebrew/bin/brew tap
```shell
d12frosted/emacs-plus
homebrew/bundle
homebrew/cask
homebrew/core

flake.nix

 # inputs
 homebrew-emacs-plus = {
      url = "github:d12frosted/homebrew-emacs-plus";
      flake = false;
 };

### outputs   darwinConfigurations
       macos = darwin.lib.darwinSystem {
          system = "aarch64-darwin";
          specialArgs = inputs;
          modules = [
             home-manager.darwinModules.home-manager
             nix-homebrew.darwinModules.nix-homebrew
             {
             nix-homebrew = {
              enable = true;
             user = "${user}";
              taps = {
                  "homebrew/homebrew-core" = homebrew-core;
                  "homebrew/homebrew-cask" = homebrew-cask;
                  "d12frosted/emacs-plus"  = homebrew-emacs-plus;
                  "homebrew/homebrew-bundle" = homebrew-bundle;
                };
               mutableTaps = false;
               autoMigrate = true;
              };
          }
            ./hosts/darwin
          ];

modules/darwin/brews.nix

homebrew = {
    enable = true;
    casks = pkgs.callPackage ./casks.nix {};
    brews = [
  {
    name = "emacs-plus@30";
    args = [
      "with-mailutil"
      "with-xwidgets"
      "with-imagemagick"
      "with-native-comp"
      "with-poll"
    ];
  }
];
dustinlyons commented 9 months ago

Hi, I am not sure, I have not used the emacs-plus homebrew tap. I would check with that team; you will encounter errors with Nix from time to and time and should check with the owner of that code.

dustinlyons commented 9 months ago

I would check with this team: https://github.com/d12frosted/homebrew-emacs-plus

injae commented 9 months ago

It seems that the brew tap command in home-manager is functioning correctly when using a version that does not have nix-homebrew installed. It seems to be an issue with nix-homebrew.

Changes

Remove all configurations related to nix-homebrew and install Homebrew separately. Then, use Homebrew taps with home-manager.

   taps = [                                                                
       "d12frosted/emacs-plus"
     ];

   brews = [
       {
         name = "emacs-plus@30";
         args = [
           "with-mailutil"
           "with-xwidgets"
            "with-imagemagick"
            "with-native-comp"
          "with-poll"
         ];
       }
  ];
dustinlyons commented 9 months ago

Interesting. You may want to open an Issue with the nix-homebrew owner if you've identified the issue. I've not run into unreadable package issues so far, but it could be something with the "@30" syntax that is causing the error. Not using nix-homebrew is just fine, it just means you have that extra step of installing homebrew with Nix. I ran this configuration like that for over a year.

injae commented 9 months ago

I have resolved the issue by manually installing Brew, and it seems like the problem is related to nix-homebrew. Therefore, I will close the issue.
Thanks for your help 🙇 👍