summaryrefslogtreecommitdiff
path: root/modules/darwin/base/nix.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/darwin/base/nix.nix')
-rw-r--r--modules/darwin/base/nix.nix24
1 files changed, 24 insertions, 0 deletions
diff --git a/modules/darwin/base/nix.nix b/modules/darwin/base/nix.nix
new file mode 100644
index 0000000..14aa805
--- /dev/null
+++ b/modules/darwin/base/nix.nix
@@ -0,0 +1,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;
+ };
+}