Difference between `nix.settings.auto-optimise-store` and `nix.optimise.automatic`

I don’t get what’s the difference between nix.settings.auto-optimise-store and nix.optimise.automatic.

nix.settings.auto-optimise-store affects the nix deamon and nix.optimise.automatic affects a dedicated systemd service. However, both say they optimize the nix store.

What’s the catch here? What’s the relation between both options?

nix.settings.auto-optimise-store makes nix to optimise the store after each and every build (for the built path).

nix.optimise.automatic sets up a systemd timer that regularly goes over all paths and optimises them. By default that happens daily, but you can configure derivating schedules.

3 Likes