summaryrefslogtreecommitdiffstats
path: root/common/nix.nix
blob: 0e58908c2508de81360c02fa04d4a051b88317b0 (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
inputs: {
  config,
  lib,
  ...
}: {
  nix = {
    gc = {
      automatic = true;
      dates = "03:15";
      options = "--delete-older-than 30d";
    };

    settings = {
      auto-optimise-store = true;
      extra-experimental-features = ["nix-command" "flakes"];
    };

    registry = lib.mapAttrs (_name: value: {flake = value;}) inputs;
    nixPath =
      lib.mapAttrsToList
      (name: value: "${name}=${value.flake}")
      (lib.filterAttrs
        (name: value: name != "self" && value.flake != null)
        config.nix.registry);
  };
}