summaryrefslogtreecommitdiff
path: root/modules/darwin/base/nix.nix
blob: 14aa80531e29ce9c035106a3e1b9d76bfee7f014 (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
{
  config,
  lib,
  ...
}: let
  cfg = config.getchoo.base.nix-settings;
  inherit (lib) mkDefault mkEnableOption mkIf;
in {
  options.getchoo.base.nix-settings.enable = mkEnableOption "base nix settings";

  config = mkIf cfg.enable {
    nix = {
      gc.automatic = mkDefault true;

      settings = {
        auto-optimise-store = true;
        experimental-features = ["nix-command" "flakes" "auto-allocate-uids" "repl-flake"];
        trusted-users = mkDefault ["root" "@wheel"];
      };
    };

    services.nix-daemon.enable = true;
  };
}