query
On this page

linkFarmFromDrvs

pkgs.linkFarmFromDrvs

Docs pulled from | This Revision | about 1 hour ago


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.

Inputs

name

1. Function argument

drvs

2. Function argument

Examples

linkFarmFromDrvs usage 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

Noogle detected

Implementation

The following is the current implementation of this function.

linkFarmFromDrvs =
    name: drvs:
    let
      mkEntryFromDrv = drv: {
        name = drv.name;
        path = drv;
      };
    in
    linkFarm name (map mkEntryFromDrv drvs);