diff options
author | Chris McDonough <chrism@plope.com> | 2024-01-12 22:59:49 -0500 |
---|---|---|
committer | Chris McDonough <chrism@plope.com> | 2024-01-12 22:59:49 -0500 |
commit | b0f542304df44f97abe8c497dce917c53d7cd972 (patch) | |
tree | ea19dad9d76f312ca7d0b4512ef42b6286c25bdb /doc/build-helpers | |
parent | 39227d5ce39c9004972ca3b15e89268ceaeca7db (diff) |
add to example
Diffstat (limited to 'doc/build-helpers')
-rw-r--r-- | doc/build-helpers/trivial-build-helpers.chapter.md | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/doc/build-helpers/trivial-build-helpers.chapter.md b/doc/build-helpers/trivial-build-helpers.chapter.md index c8c141cc83e5..d21b311516d9 100644 --- a/doc/build-helpers/trivial-build-helpers.chapter.md +++ b/doc/build-helpers/trivial-build-helpers.chapter.md @@ -72,6 +72,9 @@ Each of these functions will cause a derivation to be produced. When you coerce Some of these functions will put the resulting files within a directory inside the derivation output. If you need to refer to the resulting files somewhere else in Nix code, remember to append the path to the file For example: ```nix + +# if the derivation destination is a directory.... + my-file = writeTextFile { name = "my-file"; text = '' @@ -80,6 +83,9 @@ my-file = writeTextFile { destination = "/share/my-file"; } +# remember to tack on "/share/my-file" to the derivation path when +# using it elsewhere. + writeShellScript "evaluate-my-file.sh" '' cat ${my-file}/share/my-file ''; |