|
|
|
|
|
by 418tpot
433 days ago
|
|
Interesting, are you saying that instead of reaching for `let foo = bar; in expr` you usually use something like `with { foo = bar; }; expr`? > Since it uses attrsets, we can use their existing functionality, like `rec` and `inherit`; rather than duplicating it. `let` supports `inherit`, and is always `rec`. Or is that your point, that it is needlessly duplicated functionality? |
|
Functions with default arguments are also very useful; especially since `nix-build` will call them automatically. Those are "always `rec`" too, which (a) makes them convenient for intermediate values, and (b) provides a fine-grained way to override some functionality. I used this to great effect at a previous employer, for wrangling a bunch of inter-dependent Maven projects; but here's a made-up example: