[Nix-dev] Build dependent haskell packages

lewo at abesis.fr lewo at abesis.fr
Tue Nov 10 17:20:30 CET 2015


Hello,

I'm trying to install xmonad-0.12 and xmonad-contrib-0.12 by building a
nix package for each of these ones. To build nix packages, I use cabal2nix.

I first build and install xmonad-0.12 nix package as illustrated:
  nix-env -qas -A nixos.pkgs.haskellPackages.xmonad
  IP-  haskell-xmonad-ghc7.8.3-0.12-shared

I then trying to install xmonad-contrib-0.12 but I've a dependency
problem:
  nix-env -i -A nixos.pkgs.haskellPackages.xmonadContrib
  installing ‘haskell-xmonad-contrib-ghc7.8.3-0.12-shared’
  these derivations will be built:
    /nix/store/nc6c7s900y4sfr5ahyhzlak52vdklv3y-haskell-xmonad-contrib-ghc7.8.3-0.12-shared.drv
  building path(s) ‘/nix/store/974kiz5pv8xrnlxrh82zc9jx6srb0abz-haskell-xmonad-contrib-ghc7.8.3-0.12-shared’
  building /nix/store/974kiz5pv8xrnlxrh82zc9jx6srb0abz-haskell-xmonad-contrib-ghc7.8.3-0.12-shared
  unpacking sources
  unpacking source archive /nix/store/m99qm4zwsyda3c8gqa4hj5nk03fv9z7i-XMonadContrib
  source root is XMonadContrib
  patching sources
  configuring
  [1 of 1] Compiling Main             ( Setup.lhs, /tmp/nix-build-haskell-xmonad-contrib-ghc7.8.3-0.12-shared.drv-0/Main.o )
  Linking Setup ...
  configure flags: --enable-split-objs --disable-library-profiling --enable-shared --enable-library-vanilla --enable-executable-dynamic --enable-tests  --ghc-option=-optl=-Wl,-rpath=/nix/store/974kiz5pv8xrnlxrh82zc9jx6srb0abz-haskell-xmonad-contrib-ghc7.8.3-0.12-shared/lib/ghc-7.8.3/xmonad-contrib-0.12
  Configuring xmonad-contrib-0.12...
  Setup: At least the following dependencies are missing:
  xmonad ==0.12.*
  builder for ‘/nix/store/nc6c7s900y4sfr5ahyhzlak52vdklv3y-haskell-xmonad-contrib-ghc7.8.3-0.12-shared.drv’ failed with exit code 1
  error: build of ‘/nix/store/nc6c7s900y4sfr5ahyhzlak52vdklv3y-haskell-xmonad-contrib-ghc7.8.3-0.12-shared.drv’ failed

  In order to override upstream version, I use the following config
  file:
  cat ~/.nixpkgs/config.nix 
  {
    packageOverrides = pkgs: rec {
      haskellPackages = with pkgs.haskellPackages; pkgs.haskellPackages // rec {
          xmonad = callPackage /home/lewo/repos/xmonad {};
          xmonadContrib = callPackage /home/lewo/repos/XMonadContrib {};
      };
    };
  }

I don't understand why this dependency is not managed by nix since it
is specified in the cabal file:
  grep "xmonad>" xmonad-contrib.cabal 
                      xmonad>=0.12   && < 0.13,

Any ideas about this?
Should I use another way to build them?

Thanks in advance,
lewo.


More information about the nix-dev mailing list