Skip to main content

nix operation

Installs nix packages and loads them into the environment.

Similarly to nix-direnv, this prevents garbage collection of dependencies by symlinking the resulting shell derivation in the user's gcroots.

info

If nix is not available on the system, this step will be ignored.

Parameters

Contains a list of objects with the following parameters:

ParameterTypeDescription
packagestringThe name of the package to install
versionstringThe version to install for the package

Examples

up:
# Will look for `shell.nix`, `default.nix` or `flake.nix`
# at the root of the work directory and use it to build
# dependencies
- nix

# Will install the listed packages
- nix:
- gawk
- gcc
- gnused

# Will install the packages defined in `file.nix`
- nix: file.nix

# Will install the packages defined in the flake `flake.nix`
- nix: flake.nix

Dynamic environment

The following variables will be set as part of the dynamic environment.

Environment variableOperationDescription
CFLAGSsuffixThe flags read from the NIX_CFLAGS_COMPILE_FOR_TARGET variable in the nix derivation
CPPFLAGSsuffixThe flags read from the NIX_CFLAGS_COMPILE_FOR_TARGET variable in the nix derivation
LDFLAGSsuffixThe flags read from the NIX_LDFLAGS variable in the nix derivation
PATHprependThe bin directories for all the packages, read from the pkgsHostTarget and pkgsHostHost variables in the nix derivation
PKG_CONFIG_PATHappendThe pkgconfig read from the PKG_CONFIG_PATH_FOR_TARGET variable in the nix derivation