nmattia / niv

Easy dependency management for Nix projects

Home Page:https://github.com/nmattia/niv

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Apple M1 issue

anandsuresh opened this issue · comments

Seeing this error running nix v2.10.3 on an Apple M1 Mac. Please do let me know what additional information I can provide to help debug this issue.

error: cycle detected in build of '/nix/store/m2g27f6hqz71lh9g0sbp2zn5mcdkrqyq-niv-0.2.19.drv' in the references of output 'bin' from output 'out'

Seems to be the same as #343 and #332 and NixOS/nixpkgs#155722, right?

yeah i get that too, and heard others with it

setting the system to x86_64-darwin helps with niv but then causes other issues for me because the system is really aarch64-darwin

Odd, I had niv working fine on this arch until a few weeks ago, then presumably as the result of a routine nixpkgs (unstable) bump in my config, I started getting this issue.

Same here, recent nixpkgs update causes this again

This is an upstream issue in nixpkgs:

And here's a workaround:

  niv =
    let
      # Workaround for https://github.com/NixOS/nixpkgs/issues/140774
      fixCyclicReference = drv:
        pkgs.haskell.lib.overrideCabal drv (_: {
          enableSeparateBinOutput = false;
        });
    in
    fixCyclicReference pkgs.haskellPackages.niv;

I'll close this ticket but please go and make some noise on the ticket upstream!

I'm nix beginner and I have no idea where to put that snippet of code

I assume the intent is to use this code as an overlay when instantiating nixpkgs?

I assume the intent is to use this code as an overlay when instantiating nixpkgs?

No, intent is to install niv CLI, so I can run eg. niv add command