summary refs log tree commit diff stats
path: root/system/settings/configuration/nix.nix
blob: d254de0e55c0b1252eb445108d86e1fb0e9465ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
{ config, pkgs, ... }:

{ nix = {
    buildCores = 0;

    daemonNiceLevel = 19;
    daemonIONiceLevel = 7;

    autoOptimiseStore = true;
    gc = {
      automatic = true;
      options = "--delete-older-than 14d";
    };
  };

  environment.systemPackages = with pkgs; [
    cachix
  ];

  system.autoUpgrade = {
    enable = true;
    flags = [ "--max-jobs" "1" ];
  };
  systemd.services.nixos-upgrade = {
    script = pkgs.lib.mkForce ''
      ${config.system.build.nixos-rebuild}/bin/nixos-rebuild boot --no-build-output --upgrade ${toString config.system.autoUpgrade.flags}
    '';
  };
}