# Flake: how make nixpkgs' self follow another input's nixpkgs?

**URL:** https://discourse.nixos.org/t/flake-how-make-nixpkgs-self-follow-another-inputs-nixpkgs/10867
**Category:** Help
**Created:** [January 7, 2021, 5:12pm UTC](https://discourse.nixos.org/t/flake-how-make-nixpkgs-self-follow-another-inputs-nixpkgs/10867 "2021-01-07T17:12:53Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![blaggacao](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/b/8edcca/32.png) [@blaggacao](https://discourse.nixos.org/u/blaggacao)
#### Post date: [January 7, 2021, 5:12pm UTC](https://discourse.nixos.org/t/flake-how-make-nixpkgs-self-follow-another-inputs-nixpkgs/10867/1 "2021-01-07T17:12:53Z")

</div>

```nix
{
  nixConfig.substituters = ["https://hydra.iohk.io"]; # only pinned nixpkgs's builds are cache hits!!!
  inputs.nixpkgs.url = "github:NixOS/nixpkgs/master";
  inputs.haskell-nix.url = "github:input-output-hk/haskell.nix?ref=flake-fixes";

  # How make so that inputs.nixpkgs **is** inputs.haskell-nix.nixpkgs?
  # like so? 
  inputs.self.nixpkgs.follow = "haskell-nix";
  # or like so?
  inputs.nixpkgs.self.follow = "haskell-nix";
  outputs = { self, nixpkgs, haskell-nix }: {
  };
}

```

The goal is to increase cache hits when building overlays.

---

<div class="post-metadata">

### Author: ![danieldk](https://discourse.nixos.org/user_avatar/discourse.nixos.org/danieldk/32/31405_2.png) [@danieldk](https://discourse.nixos.org/u/danieldk)
#### Post date: [January 7, 2021, 6:56pm UTC](https://discourse.nixos.org/t/flake-how-make-nixpkgs-self-follow-another-inputs-nixpkgs/10867/2 "2021-01-07T18:56:35Z")

</div>

There was another thread with the same question a few days ago. See:

> [@Nix flake to aggregate and concurrently update some dependencies](https://discourse.nixos.org/t/nix-flake-to-aggregate-and-concurrently-update-some-dependencies/10774/6):
>
> I do something like that (closed repository, sorry). I have a [syntaxdot flake](https://github.com/tensordot/syntaxdot/blob/c500b6a1df4554dc0e71424636b316550e583275/flake.nix) which has a nixpkgs and utils inputs. Then I use these inputs in another flake syntaxdot-models (the rec might be superfluous?): { description = "SyntaxDot models"; inputs = rec { nixpkgs.follows = "syntaxdot/nixpkgs"; syntaxdot.url = "github:tensordot/syntaxdot"; utils.follows = "syntaxdot/utils"; }; outputs = { self, nixpkgs, syntaxdot, utils }: { # ... }; } (I don’t think this was docu…
