Nixpkgs haskell module not visible

I’m trying to use System.Linux.Netlink.Simple from the netlink hackage package with nix via

$ nix-shell -p "haskell.packages.ghc8107.ghcWithPackages (pkgs: with pkgs; [ netlink ])"

[nix-shell:~/git/]$ ghc --make ListAddrs.hs
[1 of 1] Compiling Main             ( ListAddrs.hs, ListAddrs.o )

ListAddrs.hs:7:1: error:
    Could not find module `System.Linux.Netlink.Simple'
    Perhaps you meant
      System.Linux.Netlink.Route (from netlink-
      System.Linux.Netlink.Helpers (from netlink-
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
7 | import qualified System.Linux.Netlink.Simple as NLS
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

I get the same error message with cabal install netlink on ubuntu

But I did workaround this on ubuntu after a cabal build and then a cabal install inside a local git checkout of netlink.

How can I solve this with nix(-shell) ?

The problem is that the netlink package in version exposes no such module.

You can, in principle override netlink to use a git revision instead in, say , a shell.nix:

{ pkgs ? import <nixpkgs> {} }:

  myHaskellPackages = pkgs.haskellPackages.override {
    overrides = self: super: {
      netlink = haskell.lib.compose.overrideSrc {
        src = /* insert appropriate fetchFromGitHub call here */;
        version = "git";


pkgs.mkShell {
  packages = [
    (myHaskellPackages.ghc.withPackages (p: [ p.netlink ]))

Thanks @sternenseemann! Your solution worked.