Low-level derivations: Difference between revisions
→Standard environment: again, ugh, character escapes |
Remove wip and add link back to derivations |
||
Line 1: | Line 1: | ||
Writing '''low-level derivations''' without the convenience of the [[standard environment]] requires understanding the core fundamentals of how [[Nix]] works. While writing [[derivations]] in this manner is not common, they can be useful when no utility present in the standard environment matches the required use case, as well as being an essential learning tool for understanding why <code>stdenv.mkDerivation</code> is needed in most cases. | |||
Writing '''low-level derivations''' without the convenience of the [[standard environment]] requires understanding the core fundamentals of how [[Nix]] works. While writing derivations in this manner is not common, they can be useful when no utility present in the standard environment matches the required use case, as well as being an essential learning tool for understanding why <code>stdenv.mkDerivation</code> is needed in most cases. | |||
In the section below, we'll start by writing a simple derivation that creates a script which displays the message ''"Hello, world"'' when run. While developing the Nix file, we'll be encountering the same challenges that led the Nix community to develop more ergonomic tooling. Each obstacle we hit - from missing system dependencies to path management - illustrates a core principle of Nix's purely functional build model. By the end, you'll understand both what makes Nix powerful and why most derivations use abstraction layers. | In the section below, we'll start by writing a simple derivation that creates a script which displays the message ''"Hello, world"'' when run. While developing the Nix file, we'll be encountering the same challenges that led the Nix community to develop more ergonomic tooling. Each obstacle we hit - from missing system dependencies to path management - illustrates a core principle of Nix's purely functional build model. By the end, you'll understand both what makes Nix powerful and why most derivations use abstraction layers. |