summary refs log tree commit diff stats
path: root/system
diff options
context:
space:
mode:
authorAlan Pearce2020-12-31 22:00:06 +0100
committerAlan Pearce2021-01-12 21:03:31 +0100
commit60740689e4575c353248c1aad25f7db577ce8f71 (patch)
tree2519357f02fbc6de75a9c7eeaaae6deb5231495c /system
parent4d230ecf19a7709d8fabdd1cae155057215576d0 (diff)
downloadnixfiles-60740689e4575c353248c1aad25f7db577ce8f71.tar.lz
nixfiles-60740689e4575c353248c1aad25f7db577ce8f71.tar.zst
nixfiles-60740689e4575c353248c1aad25f7db577ce8f71.zip
Move common nix-darwin config to darwin.nix
Diffstat (limited to 'system')
-rw-r--r--system/mba.nix12
-rw-r--r--system/settings/darwin.nix16
2 files changed, 15 insertions, 13 deletions
diff --git a/system/mba.nix b/system/mba.nix
index cd4d5a5b..e8d69490 100644
--- a/system/mba.nix
+++ b/system/mba.nix
@@ -7,10 +7,6 @@
     ./settings/programs/shell.nix
   ];
 
-  nixpkgs.config = {
-    allowUnfree = true;
-  };
-
   networking = {
     hostName = "mba";
   };
@@ -25,14 +21,6 @@
 
   environment.variables.LANG = "en_GB.UTF-8";
 
-  nix.gc = {
-    automatic = true;
-    user = "alan";
-    options = "--max-freed $((25 * 1024**3 - 1024 * $(df -P -k /nix/store | tail -n 1 | awk '{ print $4 }')))";
-  };
-  nix.daemonNiceLevel = 10;
-  nix.daemonIONice = true;
-
   # Used for backwards compatibility, please read the changelog before changing.
   # $ darwin-rebuild changelog
   system.stateVersion = 4;
diff --git a/system/settings/darwin.nix b/system/settings/darwin.nix
index 6143625b..629eff16 100644
--- a/system/settings/darwin.nix
+++ b/system/settings/darwin.nix
@@ -1,10 +1,24 @@
-{ config, pkgs, ... }:
+{ config, pkgs, lib, ... }:
 
 {
   services.nix-daemon = {
     enable = true;
     enableSocketListener = true;
   };
+  nix = {
+    buildCores = lib.mkDefault 0;
+    daemonIONice = true;
+    daemonNiceLevel = 10;
+    gc = {
+      automatic = true;
+      user = "alan";
+      options = "--max-freed $((25 * 1024**3 - 1024 * $(df -P -k /nix/store | tail -n 1 | awk '{ print $4 }')))";
+    };
+  };
+
+  nixpkgs.config = {
+    allowUnfree = true;
+  };
 
   programs.zsh = {
     enable = true;