Automatically cleanup and optimize nix store to avoid using up all inodes on the root fs

This commit is contained in:
Daniel Frank 2019-06-10 14:27:53 +02:00
parent 8d858ad3d8
commit 2ade5ba9d0
Signed by: tokudan
GPG key ID: 063CCCAD04182D32

View file

@ -6,7 +6,7 @@
{ {
imports = imports =
[ # Include the results of the hardware scan. [
./hardware-configuration.nix ./hardware-configuration.nix
./sshusers.nix ./sshusers.nix
./variables.nix ./variables.nix
@ -47,6 +47,11 @@
# Automatic update each day at 04:40. Will not restart the system, so a reboot every now and then is a good idea. # Automatic update each day at 04:40. Will not restart the system, so a reboot every now and then is a good idea.
system.autoUpgrade.enable = true; system.autoUpgrade.enable = true;
nix = {
autoOptimiseStore = true;
gc.automatic = true;
gc.options = "--delete-older-than 14d";
};
# Select internationalisation properties. # Select internationalisation properties.
i18n = { i18n = {