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.8k stars 113 forks source link

Homebrew not found #60

Closed GalGavu closed 8 months ago

GalGavu commented 8 months ago

I somehow run into situation:

➜  nixos-config nix run .#build-switch

Running build-switch for aarch64-darwin
Starting build...
Switching to new generation...
building the system configuration...
setting up Homebrew (/opt/homebrew)...
ln: /opt/homebrew/bin/brew: No such file or directory

Can you tell me what's wrong? :)

dustinlyons commented 8 months ago

When I check that directory, I see I have a brew linked:

/opt/homebrew/bin ❯ ls -alt
total 0
drwxrwxr-x 27 dustin admin 864 Mar  5 17:45 .
lrwxr-xr-x  1 root   admin  48 Mar  5 17:45 brew -> /nix/store/5mpmg28qc330darj1rwp05cdc2dkk0gn-brew

Perhaps it's an active bug with nix-homebrew? Building the system should create that symlink.

GalGavu commented 8 months ago

@dustinlyons I tried:

➜  nixos-config nix run .#build

Running build for aarch64-darwin
Starting build...
Cleaning up...
Switch to new generation complete!
➜  nixos-config nix run .#build-switch

Running build-switch for aarch64-darwin
Starting build...
Switching to new generation...
building the system configuration...
setting up Homebrew (/opt/homebrew)...
ln: /opt/homebrew/bin/brew: No such file or directory

but still the same

GalGavu commented 8 months ago

Now when I tried from scratch with installed homebrew at the beginning I've got:

➜  nixos-config nix run .#build-switch
Running build-switch for aarch64-darwin
Starting build...
Switching to new generation...
building the system configuration...
setting up Homebrew (/opt/homebrew)...
Warning: An existing /opt/homebrew/Library/Homebrew is in the way
Warning: /opt/homebrew seems to contain an existing copy of Homebrew.
==> Looks like an Apple Silicon installation (Homebrew prefix is the repository)
==> Attempting to migrate Homebrew installation...
Removing stray vendor directory
ln: /opt/homebrew/bin/brew: No such file or directory
GalGavu commented 8 months ago

I've completely removed /opt/homebrew, removed nix, reinstalled and it works now :)