[Nix-dev] Getting nix-shell to consider config.nix

Mateusz Kowalczyk fuuzetsu at fuuzetsu.co.uk
Sun Jun 1 15:53:22 CEST 2014


My ~/.nixpkgs/config.nix is as follows:

###

{ pkgs }:

{ packageOverrides = self: with pkgs; rec {

  ghc = self.ghc // {
    ghcHEAD = callPackage /home/shana/programming/ghc {};
  };

}; }

###

What I think it does is overrides ghcHEAD packages with the package I
have in the specified path. In fact, nix-env -qaP | egrep -i ghcHEAD
shows: nixpkgs.ghc.ghcHEAD ghc-7.9.20140530

This is consistent with the version in my default.nix at the specified path.

Now I want to use this in another project, through nix-shell (and
otherwise).

At the top of it I have

###

{ haskellPackages ? (import <nixpkgs> {}).haskellPackages_ghcHEAD
, …
}:

###

But that wants to pull in 7.9.20140430 which is what ghcHEAD version is
in nixpkgs itself so clearly it's omitting my config.nix. How can I get
nix-shell to look in my config? I tried playing with variety of --arg
stuff but no matter what I try, it tells me that ~/.nixpkgs/config.nix
doesn't exist so I must be using it wrong.

-- 
Mateusz K.


More information about the nix-dev mailing list