summaryrefslogtreecommitdiff
path: root/modules/shared/base/nix.nix
blob: 21af0e025fb49deccfef552e632bf096b2dd98f2 (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
{
  config,
  lib,
  pkgs,
  ...
}: let
  cfg = config.base.nix-settings;
  inherit (lib) mkDefault mkEnableOption mkIf;
  inherit (pkgs.stdenv) isLinux;
in {
  options.base.nix-settings.enable = mkEnableOption "base nix settings";

  config = mkIf cfg.enable {
    nix = {
      settings = {
        auto-optimise-store = isLinux;
        experimental-features = ["nix-command" "flakes" "auto-allocate-uids" "repl-flake"];
      };

      gc = {
        automatic = mkDefault true;
        options = mkDefault "--delete-older-than 7d";
      };
    };
  };
}