Today I did some experiment in nix repl
, and I found that nix does not have a derivation type but a set with some special attrs will be treated as a derivation. My (maybe noob) questions are:
- Why? What’s the motivation to not define a dedicated derivation type?
- Is that possible to construct arbitrary derivations by hand? e.g. some derivations that has the
outPath
or one of its dependencies outside of/nix/store
? I noticed that when building a derivation it will be validated first, which aspects will be tested? Or in other words, what makes a valid derivation. -
let s = { outPath = "foo"; }; in "${s}"
returns"foo"
, is it an intended behavior?