depot/third_party/nixpkgs/doc/build-helpers/dev-shell-tools.chapter.md
Default email f34ce41345 Project import generated by Copybara.
GitOrigin-RevId: b73c2221a46c13557b1b3be9c2070cc42cf01eb3
2024-07-27 08:49:29 +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.valueToString

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

:::{.example}

valueToString usage examples

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