Ca-derivations: Difference between revisions
imported>Ericson2314 m Fix markup |
Don't say that an unstable nix is required; this is long since available on stable releases |
||
| (4 intermediate revisions by 4 users not shown) | |||
| Line 5: | Line 5: | ||
== Setting-up Nix for CA derivations == | == Setting-up Nix for CA derivations == | ||
Being still an experimental feature, CA derivations | Being still an experimental feature, CA derivations currently require an explicit opt-in. | ||
=== On NixOS === | === On NixOS === | ||
| Line 12: | Line 12: | ||
<syntaxhighlight lang="nix">{ pkgs, ... }: { | <syntaxhighlight lang="nix">{ pkgs, ... }: { | ||
nix | nix.settings.experimental-features = [ | ||
"ca-derivations" | |||
]; | |||
}</syntaxhighlight> | }</syntaxhighlight> | ||
=== Non NixOS === | === Non NixOS === | ||
| Line 29: | Line 26: | ||
== Using CA derivations == | == Using CA derivations == | ||
The feature is | The feature is opt-in, meaning that each derivation must individually be marked as content-addressed. When using <code>nixpkgs-unstable</code>, this can be done by setting <code>__contentAddressed = true</code> in the call to mkDerivation. | ||
It is also possible to mark all the derivations as content-addressed by default, by passing <code>config.contentAddressedByDefault = true</code> as argument to nixpkgs. | It is also possible to mark all the derivations as content-addressed by default, by passing <code>config.contentAddressedByDefault = true</code> as argument to nixpkgs. | ||
== Ensuring that a derivation is properly content-addressed == | == Ensuring that a derivation is properly content-addressed == | ||