Currently I am having some trouble using an Idris package that was installed with nixpkg in another Idris package that depends on it. Both of these packages have been tested on a Debian system, so the problem is not with the Idris code itself, but rather somewhere in how they are being installed on the NixOS system. I believe I can successfully install the first package by calling nix-env -f math.nix -i idris_math
where math.nix
is defined as:
with import <nixpkgs> { };
stdenv.mkDerivation rec {
name = "idris_math";
idris = haskellPackages.idris;
buildDepends = [ idris ];
src = ./.;
preHook = ''
ln -sv ${idris}/share/x86_64-linux-ghc-8.0.1/${idris.name}/libs $PWD/libs
export IDRIS_LIBRARY_PATH=$PWD/libs
'';
configurePhase = ''
export TARGET=$out/lib/${idris.name}
'';
buildPhase = ''
${idris}/bin/idris --build *.ipkg
'';
installPhase = ''
${idris}/bin/idris --install *.ipkg
${idris}/bin/idris --clean *.ipkg
'';
}
I can then run nix-env -q
and see that idris_math
has been installed. The second nixpkg looks identical to math.nix
, except the name is changed and the buildDepends
line is now buildDepends = [ idris idris_math ]
. When I try to build or install this package however, I am met with error: undefined variable 'idris_math'
. Does anyone know what I am doing wrong, or of a way to fix this?