Closed Anton-4 closed 2 years ago
After further investigation, it looks like this would require unstable nix packages.
See also the discussion here, looks like there are some issues still: https://github.com/nmattia/niv/issues/332
My colleague @BrianHicks found the following workaround:
diff --git a/shell.nix b/shell.nix
--- a/shell.nix
+++ b/shell.nix
let
sources = import nix/sources.nix { };
- pkgs = import sources.nixpkgs { };
+ pkgs = import sources.nixpkgs {
+ system = if builtins.currentSystem == "aarch64-darwin" then
+ "x86_64-darwin"
+ else
+ builtins.currentSystem;
+ };
inputs = with pkgs; [
# meta-tools
- (import sources.niv { }).niv
+ (pkgs.callPackage sources.niv { }).niv
];
This is not an airtight solution and may introduce some other problems, but I'm posting it here in case it can help anyone.
Ah, looks like you're piggy backing on rosetta then? Arguably the shell.nix
isn't great; you shouldn't have to tweak it to specify the system. It would be great to have system
as an argument of default.nix
and shell.nix
. PR welcome!
I'd like to, but I am both a nix beginner and short on spare time.
Regarding potential problems using the workaround, this fixed it for me:
extra-platforms = x86_64-darwin
to /etc/nix/nix.conf
(create the file if it does not exist)softwareupdate --install-rosetta
For any future readers; I ran into more problems with this approach down the road, so instead I forked niv to make it use unstable packages, which fixed my issues.
Thanks! I've created a PR to bump nixpkgs to the latest master. Would you mind giving it a try?
Fixed in #339
Thanks @nmattia :heart:
Trying to install master with:
Results in:
Updating to at least ghc-8.10.6 should fix this issue. I did not see a ghc version defined in the code anywhere, so I was unable to fix the issue myself.