summaryrefslogtreecommitdiff
path: root/modules/darwin/base/nix.nix
blob: cac2290ecd741fac3ef61f4e95c82c00bf6d4796 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{
  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 = {
        experimental-features = ["nix-command" "flakes" "auto-allocate-uids" "repl-flake"];
        trusted-users = mkDefault ["root" "@wheel"];
      };
    };

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