# Custom subscopes for \`haskellPackages\`

**URL:** https://discourse.nixos.org/t/custom-subscopes-for-haskellpackages/2998
**Category:** Help
**Created:** [May 22, 2019, 1:08pm UTC](https://discourse.nixos.org/t/custom-subscopes-for-haskellpackages/2998 "2019-05-22T13:08:56Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![fghibellini](https://discourse.nixos.org/user_avatar/discourse.nixos.org/fghibellini/32/1195_2.png) [@fghibellini](https://discourse.nixos.org/u/fghibellini)
#### Post date: [May 22, 2019, 1:08pm UTC](https://discourse.nixos.org/t/custom-subscopes-for-haskellpackages/2998/1 "2019-05-22T13:08:56Z")

</div>

Hi everyone!

I am trying to have a “scoped” set of packages inside `haskellPackages` such that my packages wouldn’t mix up with the public ones.

This is the outline of what I currently have:

```nix
ps = { package1 = ../code/package1; package2 = ../code/package2; };
config = {
    packageOverrides = pkgs: {
      haskellPackages = pkgs.haskellPackages.override {
       overrides = self: super: { my-packages = builtins.mapAttrs (name: path: (super.callCabal2nix name (gitignore path) {}) ps; } ;
      };
    };
  };

```

I want `package1` to be able to specify `package2` as a dependency even though `package2` is not directly in the haskell package set but inside the attribute `my-packages`. (basically add `self.haskellPackages.my-packages` to the scope `callCabal2nix` uses to resolve inputs)

I noticed there’s a `overrideScope` function in nixpkgs but I didn’t figure out how to use it.

Thanks!
