summary refs log tree commit diff stats
path: root/modules/configuration/nix.nix
blob: e20a6fcb0db3571e2cd0c5596e7e8f02690b2ec1 (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
30
31
32
{ config, pkgs, ... }:

{ nix = {
    buildCores = 0;

    daemonNiceLevel = 10;
    daemonIONiceLevel = 4;

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

  nixpkgs.config = {
    packageOverrides = pkgs: {
      unstable = import <nixos-unstable> {
        config = config.nixpkgs.config;
      };
    };
  };

  system.autoUpgrade = {
    enable = true;
  };
  systemd.services.nixos-upgrade = {
    script = pkgs.lib.mkForce ''
      ${config.system.build.nixos-rebuild}/bin/nixos-rebuild boot ${toString config.system.autoUpgrade.flags}
    '';
  };
}