From 3e054571d73ccacfec7b1d4714bfa74818b7affe Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 9 Sep 2017 16:40:31 +0200 Subject: Add nix configuration --- modules/nix.nix | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 modules/nix.nix (limited to 'modules') diff --git a/modules/nix.nix b/modules/nix.nix new file mode 100644 index 0000000..35b7cea --- /dev/null +++ b/modules/nix.nix @@ -0,0 +1,24 @@ +{ config, pkgs, ... }: + +{ nix = { + buildCores = 0; + + daemonNiceLevel = 10; + daemonIONiceLevel = 4; + + extraOptions = '' + auto-optimise-store = true; + ''; + gc = { + automatic = true; + options = "--delete-older-than 30d"; + }; + }; + + system.autoUpgrade = { + enable = true; + }; + systemd.services.nixos-upgrade.script = '' + ${config.system.build.nixos-rebuild}/bin/nixos-rebuild boot ${toString config.system.autoUpgrade.flags} + ''; +} -- cgit 1.4.1