Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: home-manager can't install pkgs on Apple M1 chip #2266

Closed
1 task done
jduan opened this issue Aug 13, 2021 · 5 comments
Closed
1 task done

bug: home-manager can't install pkgs on Apple M1 chip #2266

jduan opened this issue Aug 13, 2021 · 5 comments

Comments

@jduan
Copy link

jduan commented Aug 13, 2021

Is there an existing issue for this?

  • I have searched the existing issues

Issue description

I was able to install home-manager on my macbook pro (2021 M1 chip) but I can't use it to install any packages.

home-manager switch fails right away with this error:

~ % home-manager switch
error: cannot bootstrap GHC on this platform ('aarch64-darwin' with libc 'defaultLibc')
(use '--show-trace' to show detailed location information)

Can you help? Thanks!

Maintainer CC

No response

System information

- system: `"aarch64-darwin"`
 - host os: `Darwin 20.6.0, macOS 11.5.1`
 - multi-user?: `no`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.3.15`
 - channels(jduan): `"home-manager-21.05, nixpkgs-21.11pre308173.10bb0364861"`
 - nixpkgs: `/Users/jduan/.nix-defexpr/channels/nixpkgs`
@jduan jduan added bug triage Issues or feature request that have not been triaged yet labels Aug 13, 2021
@berbiche berbiche added system: darwin and removed triage Issues or feature request that have not been triaged yet labels Aug 17, 2021
@berbiche
Copy link
Member

berbiche commented Aug 17, 2021

Hi,

I don't have an m1 machine to test this but AFAIK some of the packages you are trying to install simply cannot be built on m1, GHC being one of those.

Can you try to get into a nix-shell with ghc and report if it works nix-shell -p ghc?

edit: You will need to look into cross compilation until GHC correctly supports aarch64.

@jduan
Copy link
Author

jduan commented Aug 18, 2021

Running nix-shell -p ghc gives the same error:

error: Package ‘ghc-8.10.4’ in /nix/store/as4m9wx3h99b3v4dgcspbc47md5g1kjw-nixpkgs-21.11pre308173.10bb0364861/nixpkgs/pkgs/development/compilers/ghc/8.10.4.nix:308 is not supported on ‘aarch64-darwin’, refusing to evaluate.

From the link you shared, it seems ghc 8.10.5 is working with Apple Silicon but it hasn't made to nix-unstable yet.

Do I just need to wait at this point?

@sumnerevans
Copy link
Member

Yes, at this point there's nothing we can do on the home manager side, so I think you will just have to wait until it's resolved in upstream nixpkgs.

@jduan
Copy link
Author

jduan commented Aug 18, 2021

That sounds good.

@alexpearce
Copy link

ghc-8.10.6 is now supported. I'm able to install it:

$ nix-shell -p ghc -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/master.tar.gz

[nix-shell:~]$ which ghc
/nix/store/h498hkqbfhsl7b5wsl5dlz1433x9s0w7-ghc-8.10.6/bin/ghc

But the -I override does not work when installing home-manager.

$ nix-shell '<home-manager>' -A install -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/master.tar.gz

Creating initial Home Manager generation...

error: Package ‘ghc-8.10.6’ in /nix/store/y7l57wijqlphsd6g1475nvg2zgy9y81d-nixpkgs-21.11pre312229.08ef0f28e3a/nixpkgs/pkgs/development/compilers/ghc/8.10.6.nix:308 is not supported on ‘aarch64-darwin’, refusing to evaluate.

       a) To temporarily allow packages that are unsupported for this system, you can use an environment variable
          for a single invocation of the nix tools.

            $ export NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1

       b) For `nixos-rebuild` you can set
         { nixpkgs.config.allowUnsupportedSystem = true; }
       in configuration.nix to override this.

       c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
         { allowUnsupportedSystem = true; }
       to ~/.config/nixpkgs/config.nix.
(use '--show-trace' to show detailed location information)

There are 114 unread and relevant news items.
Read them by running the command 'home-manager news'.


Uh oh, the installation failed! Please create an issue at

    https://github.com/nix-community/home-manager/issues

if the error seems to be the fault of Home Manager.

Is there a way to have home-manager use the nixpkgs master?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants