Ca-derivations: Difference between revisions
imported>Ericson2314 m Fix markup |
The NGI0 Cache doesn't exist since at least summer of 2024 |
||
| (3 intermediate revisions by 3 users not shown) | |||
| 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 == | ||