about summary refs log tree commit diff
path: root/machines/profpatsch
diff options
context:
space:
mode:
authoraszlig <aszlig@nix.build>2022-08-15 17:04:53 +0200
committeraszlig <aszlig@nix.build>2022-08-15 17:31:45 +0200
commit362b3ea25da7884152d76c6ffeb100625c31138b (patch)
tree44f899cc0dcfcff7da584f7c56a1f3dec8990689 /machines/profpatsch
parent22c382665c24682f7e5433ff1f15d2004bf39338 (diff)
machines + modules: Fix Nix option definitions
Most of the options in nix.conf are now exposed as a submodule with a
freeform type and since that change[1] got introduced, we get a bunch of
warnings during machine evaluation:

  trace: warning: The option `nix.useSandbox' defined in `...' has been renamed to `nix.settings.sandbox'.
  trace: warning: The option `nix.maxJobs' defined in `...' has been renamed to `nix.settings.max-jobs'.
  trace: warning: The option `nix.buildCores' defined in `...' has been renamed to `nix.settings.cores'.

To shut them up, I went through all machines and modules and renamed the
remaining options that were not renamed back then when @devhell did some
renames in a0297bf921399c3243dcca99626d8697f0735abe.

This was done by looking through the output of:

  $ git grep -A 10 '\<nix\(\.\| *=\)' machines modules

After that I tested the contents of the nix.conf of all the machines
against the changes this commit introduced via the following command:

  $ nix-build --no-out-link -E '
      with import <nixpkgs/lib>;
      map (m: m.eval.config.environment.etc."nix/nix.conf".source)
          (collect (m: m ? eval) (import ./machines))
    '

I've sorted the resulting nix.conf files and diffed on that result and
the only difference that showed up was the following:

   allowed-users = *
  -auto-optimise-store = false
   auto-optimise-store = true
   builders-use-substitutes = true
   cores = 0

This is because the previous way to generate the config was by
concatenating strings whereas the new way works on an attribute set, so
we get deduplication by design.

[1]: https://github.com/NixOS/nixpkgs/pull/139075

Signed-off-by: aszlig <aszlig@nix.build>
Cc: @devhell
Cc: @Profpatsch
Cc: @sternenseemann
Diffstat (limited to 'machines/profpatsch')
-rw-r--r--machines/profpatsch/legosi.nix7
-rw-r--r--machines/profpatsch/leguin.nix7
-rw-r--r--machines/profpatsch/mikiya.nix2
-rw-r--r--machines/profpatsch/shiki.nix7
4 files changed, 7 insertions, 16 deletions
diff --git a/machines/profpatsch/legosi.nix b/machines/profpatsch/legosi.nix
index 72709711..75fa771a 100644
--- a/machines/profpatsch/legosi.nix
+++ b/machines/profpatsch/legosi.nix
@@ -35,11 +35,8 @@ in {
         "nixpkgs=https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz"
       ];
 
-      extraOptions = ''
-        auto-optimise-store = true
-        min-free = ${toString (3 * 1024 * 1024 * 1024)}
-      '';
-
+      settings.auto-optimise-store = true;
+      settings.min-free = 3 * 1024 * 1024 * 1024;
     };
 
     vuizvui.user.profpatsch.server.sshPort = 7001;
diff --git a/machines/profpatsch/leguin.nix b/machines/profpatsch/leguin.nix
index 7b1364ec..d55147c1 100644
--- a/machines/profpatsch/leguin.nix
+++ b/machines/profpatsch/leguin.nix
@@ -28,11 +28,8 @@ in
         "nixpkgs=https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz"
       ];
 
-      extraOptions = ''
-        auto-optimise-store = true
-        min-free = ${toString (3 * 1024 * 1024 * 1024)}
-      '';
-
+      settings.auto-optimise-store = true;
+      settings.min-free = 3 * 1024 * 1024 * 1024;
     };
 
     boot.initrd.luks.devices.cryptroot.device = "/dev/disk/by-label/root";
diff --git a/machines/profpatsch/mikiya.nix b/machines/profpatsch/mikiya.nix
index 74acc76b..915f1243 100644
--- a/machines/profpatsch/mikiya.nix
+++ b/machines/profpatsch/mikiya.nix
@@ -63,7 +63,7 @@ in {
       fsType = "ext3";
     };
 
-    nix.maxJobs = 4;
+    nix.settings.max-jobs = 4;
 
     vuizvui.user.profpatsch.server.sshPort = 22;
 
diff --git a/machines/profpatsch/shiki.nix b/machines/profpatsch/shiki.nix
index ca62cf85..0cc1112b 100644
--- a/machines/profpatsch/shiki.nix
+++ b/machines/profpatsch/shiki.nix
@@ -152,11 +152,8 @@ in {
     nix.settings.trusted-public-keys = [
       "digitallyinduced.cachix.org-1:y+wQvrnxQ+PdEsCt91rmvv39qRCYzEgGQaldK26hCKE="
     ];
-
-    nix.extraOptions = ''
-      builders-use-substitutes = true
-      auto-optimise-store = true
-    '';
+    nix.settings.builders-use-substitutes = true;
+    nix.settings.auto-optimise-store = true;
 
     ##########
     # Network