nixpkgs/doc/build-helpers/dev-shell-tools.chapter.md
2024-06-29 17:21:01 +02:00

1.2 KiB

Development Shell helpers

The nix-shell command has popularized the concept of transient shell environments for development or testing purposes.

However, nix-shell is not the only way to create such environments, and even nix-shell itself can indirectly benefit from this library.

This library provides a set of functions that help create such environments.

devShellTools.stringValue

Converts Nix values to strings in the way the derivation built-in function does.

:::{.example}

stringValue usage examples

devShellTools.stringValue (builtins.toFile "foo" "bar")
=> "/nix/store/...-foo"
devShellTools.stringValue false
=> ""