1

Just got started with Nix (version 2.2.1), and while installing darcs (version 2.14.1) i encountered my first problem: I get the following error message (preceded by the callstack):

Setup: Encountered missing dependencies:
base >=4.9 && <4.12,
network >=2.6 && <2.8,
stm >=2.1 && <2.5,
zip-archive ==0.3.*

I have the haskell tool stack installed as well as a global ghc (though both should not be needed to build darcs i think).

I also had no problem with installing darcs with 'apt'

Am i making a classic nix beginner mistake or whats going on here?

Ulfhorst1
  • 11
  • 3

1 Answers1

1

Nix is very different from package managers like 'apt'. Derivations (which are like packages) are designed to be built in an isolated environment, where the derivation is responsible for providing its own dependencies by referencing other derivations. Because of this, you do not need to explicitly install anything in order to build a package.

Note also that although Nixpkgs uses the Cabal library to build Haskell packages, installing a package via Nix is quite different from installing with cabal-install. In fact it is closer to Stack, because Nixpkgs defines its haskellPackages based on stackage and it avoids cabal-style dependency resolution. It does however let you use the Cabal solver to check whether the dependencies match the versions specified in the cabal files. This check can be disabled using the doJailbreak function in Nixpkgs.

I don't think we need to get into the details of Haskell packaging in Nixpkgs though, because you should be able to get a pre-built darcs from the nixos-18.09 channel. The Nix expression from the nixos-unstable produces exactly your error message.

I recommend you to use the latest release channel, nixos-18.09, because nixos-unstable will break regularly. See the Nix manual for changing your channel configuration.

Robert Hensing
  • 6,708
  • 18
  • 23
  • Thank you for the response. I tried using the `nixos-18.09` channel (i also unsubscribed to every other channel, just to be sure), and i still got the exact same error message. – Ulfhorst1 Jan 17 '19 at 08:01
  • Did you run `nix-channel --update`? I think that the manual should have a more prominent warning about this. – Robert Hensing Jan 18 '19 at 10:26