anchor.diff:          ${postBuild}
         '';
   
  +  /*
  +   * Quickly create a set of symlinks to derivations.
  +   *
  +   * This creates a simple derivation with symlinks to all inputs.
  +   *
  +   * entries is a list of attribute sets like
  +   * { name = "name" ; path = "/nix/store/..."; }
  +   *
  +   * Example:
  +   *
  +   * # Symlinks hello and stack paths in store to current $out/hello-test and
  +   * # $out/foobar.
  +   * linkFarm "myexample" [ { name = "hello-test"; path = pkgs.hello; } { name = "foobar"; path = pkgs.stack; } ]
  +   *
  +   * This creates a derivation with a directory structure like the following:
  +   *
  +   * /nix/store/qc5728m4sa344mbks99r3q05mymwm4rw-myexample
  +   * |-- foobar -> /nix/store/6lzdpxshx78281vy056lbk553ijsdr44-stack-2.1.3.1
  +   * `-- hello-test -> /nix/store/qy93dp4a3rqyn2mz63fbxjg228hffwyw-hello-2.10
  +   *
  +   * See the note on symlinkJoin for the difference between linkFarm and symlinkJoin.
  +   */
  +  linkFarm = name: entries: runCommand name { preferLocalBuild = true; allowSubstitutes = false; }
  +    ''mkdir -p $out
  +      cd $out
  +      ${lib.concatMapStrings (x: ''
  +          mkdir -p "$(dirname ${lib.escapeShellArg x.name})"
  +          ln -s ${lib.escapeShellArg x.path} ${lib.escapeShellArg x.name}
  +      '') entries}
  +    '';
  +
  +  /*
  +   * Easily create a linkFarm from a set of derivations.
  +   *
  +   * This calls linkFarm with a list of entries created from the list of input
  +   * derivations.  It turns each input derivation into an attribute set
  +   * like { name = drv.name ; path = drv }, and passes this to linkFarm.
  +   *
  +   * Example:
  +   *
  +   * # Symlinks the hello, gcc, and ghc derivations in $out
  +   * linkFarmFromDrvs "myexample" [ pkgs.hello pkgs.gcc pkgs.ghc ]
  +   *
  +   * This creates a derivation with a directory structure like the following:
  +   *
  +   * /nix/store/m3s6wkjy9c3wy830201bqsb91nk2yj8c-myexample
  +   * |-- gcc-wrapper-9.2.0 -> /nix/store/fqhjxf9ii4w4gqcsx59fyw2vvj91486a-gcc-wrapper-9.2.0
  +   * |-- ghc-8.6.5 -> /nix/store/gnf3s07bglhbbk4y6m76sbh42siym0s6-ghc-8.6.5
  +   * `-- hello-2.10 -> /nix/store/k0ll91c4npk4lg8lqhx00glg2m735g74-hello-2.10
  +   */
  +  linkFarmFromDrvs = name: drvs:
  +    let mkEntryFromDrv = drv: { name = drv.name; path = drv; };
  +    in linkFarm name (map mkEntryFromDrv drvs);
  +
   
     /*
      * Make a package that just contains a setup hook with the given contents.
  
positive.code:     '';
  
    /*
    * Create a forest of symlinks to the files in `paths'.
    *
    * Examples:
    * # adds symlinks of hello to current build.
    * { symlinkJoin, hello }:
    * symlinkJoin { name = "myhello"; paths = [ hello ]; }
    *
    * # adds symlinks of hello to current build and prints "links added"
    * { symlinkJoin, hello }:
    * symlinkJoin { name = "myhello"; paths = [ hello ]; postBuild = "echo links added"; }
    */
    symlinkJoin =
      args_@{ name
           , paths
  
negative.code:       done < graph
      '';
  
  
    /* Print an error message if the file with the specified name and
     * hash doesn't exist in the Nix store. This function should only
  