summaryrefslogtreecommitdiff
path: root/modules/darwin/base/nix.nix
blob: 39d8ffa1f3bec2a5a958af82d807b0c50b8b7582 (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.base.nix-settings;
  inherit (lib) mkDefault mkEnableOption mkIf;
in {
  options.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;
  };
}