summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--system/prefect.nix2
-rw-r--r--system/settings/configuration/nix-linux.nix32
-rw-r--r--system/settings/configuration/nix.nix31
-rw-r--r--system/settings/darwin.nix9
4 files changed, 40 insertions, 34 deletions
diff --git a/system/prefect.nix b/system/prefect.nix
index 47a497b6..12f0dd56 100644
--- a/system/prefect.nix
+++ b/system/prefect.nix
@@ -6,7 +6,7 @@
     ./settings/base.nix
     ./settings/configuration/berlin.nix
     ./settings/configuration/british-english.nix
-    ./settings/configuration/nix.nix
+    ./settings/configuration/nix-linux.nix
     ./settings/configuration/user.nix
     ./settings/hardware/audio.nix
     ./settings/hardware/bare-metal.nix
diff --git a/system/settings/configuration/nix-linux.nix b/system/settings/configuration/nix-linux.nix
new file mode 100644
index 00000000..3b32ebd5
--- /dev/null
+++ b/system/settings/configuration/nix-linux.nix
@@ -0,0 +1,32 @@
+{ config
+, lib
+, pkgs
+, ...
+}: {
+  imports = [
+    ./nix.nix
+  ];
+
+  nix = {
+    settings = {
+      auto-optimise-store = true;
+
+      daemonCPUSchedPolicy = "idle";
+      daemonIOSchedClass = "idle";
+    };
+  };
+
+  nixpkgs.config.allowUnfree = true;
+
+  system.autoUpgrade = {
+    enable = true;
+    flags = [ "--max-jobs" "2" ];
+    flake = "/home/alan/projects/alanpearce/nixfiles";
+  };
+  systemd.services.nixos-upgrade = {
+    script = pkgs.lib.mkForce ''
+      ${pkgs.nix}/bin/nix-channel --update
+      ${config.system.build.nixos-rebuild}/bin/nixos-rebuild boot --no-build-output ${toString config.system.autoUpgrade.flags}
+    '';
+  };
+}
diff --git a/system/settings/configuration/nix.nix b/system/settings/configuration/nix.nix
index 25b9696f..c8db7836 100644
--- a/system/settings/configuration/nix.nix
+++ b/system/settings/configuration/nix.nix
@@ -8,36 +8,17 @@
   ];
   nix = {
     settings = {
-      cores = 0;
-      auto-optimise-store = true;
+      cores = lib.mkDefault 0;
       use-xdg-base-directories = true;
+      keep-outputs = true;
+      keep-derivations = true;
+      experimental-features = "nix-command flakes";
+      warn-dirty = false;
     };
 
-    daemonCPUSchedPolicy = "idle";
-    daemonIOSchedClass = "idle";
-
-    extraOptions = ''
-      keep-outputs = true
-      keep-derivations = true
-      experimental-features = nix-command flakes
-      warn-dirty = false
-    '';
-
     gc = {
       automatic = lib.mkDefault true;
-      options = "--delete-older-than 14d";
+      options = lib.mkDefault "--delete-older-than 14d";
     };
   };
-
-  system.autoUpgrade = {
-    enable = true;
-    flags = [ "--max-jobs" "2" ];
-    flake = "/home/alan/projects/alanpearce/nixfiles";
-  };
-  systemd.services.nixos-upgrade = {
-    script = pkgs.lib.mkForce ''
-      ${pkgs.nix}/bin/nix-channel --update
-      ${config.system.build.nixos-rebuild}/bin/nixos-rebuild boot --no-build-output ${toString config.system.autoUpgrade.flags}
-    '';
-  };
 }
diff --git a/system/settings/darwin.nix b/system/settings/darwin.nix
index ef039a48..aa55cce5 100644
--- a/system/settings/darwin.nix
+++ b/system/settings/darwin.nix
@@ -4,7 +4,7 @@
 , ...
 }: {
   imports = [
-    ../../pin.nix
+    ./configuration/nix.nix
   ];
   services.nix-daemon = {
     enable = true;
@@ -17,19 +17,12 @@
   ];
 
   nix = {
-    settings.cores = lib.mkDefault 0;
     daemonIOLowPriority = true;
     gc = {
-      automatic = true;
       user = "alan";
       options = "--max-freed $((25 * 1024**3 - 1024 * $(df -P -k /nix/store | tail -n 1 | awk '{ print $4 }')))";
     };
     settings.extra-platforms = "aarch64-darwin x86_64-darwin";
-    settings.experimental-features = "nix-command flakes";
-    settings.warn-dirty = false;
-    settings.keep-outputs = true;
-    settings.keep-derivations = true;
-    settings.use-xdg-base-directories = true;
 
     linux-builder.enable = true;
     settings.trusted-users = [ "@admin" ];