Storage optimization: Difference between revisions

imported>LucasWagler
Rework automatic optimisation to differentiate the two methods.
imported>LucasWagler
m Wording in Automatic Optimisation
Line 5: Line 5:


=== Automatic ===
=== Automatic ===
To turn on automatic optimisation of the nix store, set the following option in <code>/etc/nixos/configuration.nix</code>:
To turn on periodic optimisation of the nix store, set the following option in <code>/etc/nixos/configuration.nix</code>:
{{file|configuration.nix|nix|<nowiki>
{{file|configuration.nix|nix|<nowiki>
nix.optimise.automatic = true;
nix.optimise.automatic = true;
Line 11: Line 11:
</nowiki>}}
</nowiki>}}


Alternatively, the store can be optimised on ''every'' build. This may slow down builds, as discussed [https://github.com/NixOS/nix/issues/6033 here]. To enable this behavior, set the following option:
Alternatively, the store can be optimised during ''every'' build. This may slow down builds, as discussed [https://github.com/NixOS/nix/issues/6033 here]. To enable this behavior, set the following option:
{{file|configuration.nix|nix|<nowiki>
{{file|configuration.nix|nix|<nowiki>
nix.settings.auto-optimise-store = true;
nix.settings.auto-optimise-store = true;