glistix/nix/derivation_builder

Module for the DerivationBuilder type and its functions.

Types

This type lets you compose a derivation’s creation options through builder functions.

Use build to finish the creation of the derivation.

pub opaque type DerivationBuilder(name, system, builder)

Functions

pub fn build(
  derivation: DerivationBuilder(String, System, Builder),
) -> Derivation

Creates a derivation given its builder. The builder must have set a name, system and builder program for the derivation. Note that this does NOT cause the derivation to be “built” in the Nix sense; it simply creates the object representing the derivation.

pub fn new() -> DerivationBuilder(Nil, Nil, Nil)

Creates a derivation builder without any initial information.

pub fn with_builder(
  derivation: DerivationBuilder(a, b, c),
  builder: Builder,
) -> DerivationBuilder(a, b, Builder)

Sets the program and arguments which will build this derivation.

pub fn with_extra_option(
  derivation: DerivationBuilder(a, b, c),
  set name: String,
  to value: d,
) -> DerivationBuilder(a, b, c)

Sets an extra option when creating the derivation. Take care here as invalid options will cause a crash.

pub fn with_name(
  derivation: DerivationBuilder(a, b, c),
  name: String,
) -> DerivationBuilder(String, b, c)

Sets the name of the derivation being built.

pub fn with_outputs(
  derivation: DerivationBuilder(a, b, c),
  outputs: List(String),
) -> DerivationBuilder(a, b, c)

Sets the outputs of this derivation. When not specified, the outputs are just [ "out" ].

pub fn with_system(
  derivation: DerivationBuilder(a, b, c),
  system: System,
) -> DerivationBuilder(a, System, c)

Sets the system of the derivation being built.

Search Document