From cbabb6f211a44cf1dfa8b5ba3c347a76ae190fc7 Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Sun, 30 Jan 2022 20:30:20 +0000 Subject: [PATCH] ops/nixos: migrate nix.maxJobs/binaryCaches/trustedBinaryCaches to the nix.settings equivalents --- ops/nixos/bvm-heptapod/default.nix | 6 ++++-- ops/nixos/clouvider-fra01/default.nix | 2 +- ops/nixos/clouvider-lon01/default.nix | 2 +- ops/nixos/etheroute-lon01/default.nix | 2 +- ops/nixos/howl/default.nix | 2 +- ops/nixos/lib/bvm.nix | 2 +- ops/nixos/lib/common.nix | 10 ++++++---- ops/nixos/lib/frantech.nix | 2 +- ops/nixos/porcorosso/default.nix | 2 +- ops/nixos/swann/default.nix | 2 +- ops/nixos/totoro/default.nix | 2 +- 11 files changed, 19 insertions(+), 15 deletions(-) diff --git a/ops/nixos/bvm-heptapod/default.nix b/ops/nixos/bvm-heptapod/default.nix index 7c3832152e..56d3bc1459 100644 --- a/ops/nixos/bvm-heptapod/default.nix +++ b/ops/nixos/bvm-heptapod/default.nix @@ -119,8 +119,10 @@ in { ]; networking.hosts = depot.ops.nixos.tailscaleIPs; nix = { - binaryCaches = lib.mkForce [ "https://cache.nixos.org/" "s3://lukegb-nix-cache?endpoint=storage.googleapis.com&trusted=1" ]; - trustedBinaryCaches = lib.mkForce [ "https://cache.nixos.org/" "s3://lukegb-nix-cache?endpoint=storage.googleapis.com&trusted=1" ]; + settings = { + substituters = lib.mkForce [ "https://cache.nixos.org/" "s3://lukegb-nix-cache?endpoint=storage.googleapis.com&trusted=1" ]; + trusted-substituters = lib.mkForce [ "https://cache.nixos.org/" "s3://lukegb-nix-cache?endpoint=storage.googleapis.com&trusted=1" ]; + }; envVars = { AWS_ACCESS_KEY_ID = "${depot.ops.secrets.nixCache.AWS_ACCESS_KEY_ID}"; AWS_SECRET_ACCESS_KEY = "${depot.ops.secrets.nixCache.AWS_SECRET_ACCESS_KEY}"; diff --git a/ops/nixos/clouvider-fra01/default.nix b/ops/nixos/clouvider-fra01/default.nix index 6494d18bf4..bdce9fc77e 100644 --- a/ops/nixos/clouvider-fra01/default.nix +++ b/ops/nixos/clouvider-fra01/default.nix @@ -86,7 +86,7 @@ in { }; }; - nix.maxJobs = lib.mkDefault 12; + nix.settings.max-jobs = lib.mkDefault 12; # Use systemd-boot. boot.loader.systemd-boot.enable = true; diff --git a/ops/nixos/clouvider-lon01/default.nix b/ops/nixos/clouvider-lon01/default.nix index 18bc88b657..210abf440a 100644 --- a/ops/nixos/clouvider-lon01/default.nix +++ b/ops/nixos/clouvider-lon01/default.nix @@ -68,7 +68,7 @@ in { }; }; - nix.maxJobs = lib.mkDefault 8; + nix.settings.max-jobs = lib.mkDefault 8; # Use GRUB, so we can have mirrored bootloaders. boot.loader.efi.canTouchEfiVariables = true; diff --git a/ops/nixos/etheroute-lon01/default.nix b/ops/nixos/etheroute-lon01/default.nix index d5773daee5..d47f6c4e38 100644 --- a/ops/nixos/etheroute-lon01/default.nix +++ b/ops/nixos/etheroute-lon01/default.nix @@ -109,7 +109,7 @@ in { }; }; - nix.maxJobs = lib.mkDefault 8; + nix.settings.max-jobs = lib.mkDefault 8; # Networking! networking = { diff --git a/ops/nixos/howl/default.nix b/ops/nixos/howl/default.nix index 128b09a7cf..851944eb1a 100644 --- a/ops/nixos/howl/default.nix +++ b/ops/nixos/howl/default.nix @@ -51,7 +51,7 @@ in { }; }; - nix.maxJobs = lib.mkDefault 12; + nix.settings.max-jobs = lib.mkDefault 12; powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; hardware.enableRedistributableFirmware = true; diff --git a/ops/nixos/lib/bvm.nix b/ops/nixos/lib/bvm.nix index ab14c16f6d..996fa3cbfd 100644 --- a/ops/nixos/lib/bvm.nix +++ b/ops/nixos/lib/bvm.nix @@ -43,7 +43,7 @@ boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; - nix.maxJobs = lib.mkDefault 2; + nix.settings.max-jobs = lib.mkDefault 2; my.rundeck.tags = [ "bvm" ]; diff --git a/ops/nixos/lib/common.nix b/ops/nixos/lib/common.nix index 89b258ac27..3e8f8fe568 100644 --- a/ops/nixos/lib/common.nix +++ b/ops/nixos/lib/common.nix @@ -101,11 +101,13 @@ in my.rundeck.tags = [ "nixos" ]; nix = { - nixPath = [ "depot=/home/lukegb/depot/" "nixpkgs=/home/lukegb/depot/third_party/nixpkgs/" ]; package = pkgs.nix_2_3; # Use a working nix. - trustedUsers = [ "root" "@wheel" "deployer" ]; - binaryCaches = lib.mkForce [ "https://cache.nixos.org/" "s3://lukegb-nix-cache?endpoint=storage.googleapis.com&trusted=1" ]; - trustedBinaryCaches = lib.mkForce [ "https://cache.nixos.org/" "s3://lukegb-nix-cache?endpoint=storage.googleapis.com&trusted=1" ]; + nixPath = [ "depot=/home/lukegb/depot/" "nixpkgs=/home/lukegb/depot/third_party/nixpkgs/" ]; + settings = { + trusted-users = [ "root" "@wheel" "deployer" ]; + substituters = lib.mkForce [ "https://cache.nixos.org/" "s3://lukegb-nix-cache?endpoint=storage.googleapis.com&trusted=1" ]; + trusted-substituters = lib.mkForce [ "https://cache.nixos.org/" "s3://lukegb-nix-cache?endpoint=storage.googleapis.com&trusted=1" ]; + }; envVars = { AWS_ACCESS_KEY_ID = "${depot.ops.secrets.nixCache.AWS_ACCESS_KEY_ID}"; AWS_SECRET_ACCESS_KEY = "${depot.ops.secrets.nixCache.AWS_SECRET_ACCESS_KEY}"; diff --git a/ops/nixos/lib/frantech.nix b/ops/nixos/lib/frantech.nix index bdb636afe2..05459d3185 100644 --- a/ops/nixos/lib/frantech.nix +++ b/ops/nixos/lib/frantech.nix @@ -36,7 +36,7 @@ in { }; }; - nix.maxJobs = lib.mkDefault 1; + nix.settings.max-jobs = lib.mkDefault 1; # Networking! networking = { diff --git a/ops/nixos/porcorosso/default.nix b/ops/nixos/porcorosso/default.nix index 5f9149b242..a2dffa30c6 100644 --- a/ops/nixos/porcorosso/default.nix +++ b/ops/nixos/porcorosso/default.nix @@ -73,7 +73,7 @@ in { }; }; - nix.maxJobs = lib.mkDefault 12; + nix.settings.max-jobs = lib.mkDefault 12; powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; hardware.enableRedistributableFirmware = true; diff --git a/ops/nixos/swann/default.nix b/ops/nixos/swann/default.nix index 3a1217e976..138d78dac2 100644 --- a/ops/nixos/swann/default.nix +++ b/ops/nixos/swann/default.nix @@ -30,7 +30,7 @@ in { }; }; - nix.maxJobs = lib.mkDefault 4; + nix.settings.max-jobs = lib.mkDefault 4; # Use the systemd-boot EFI boot loader. boot.loader.systemd-boot.enable = true; diff --git a/ops/nixos/totoro/default.nix b/ops/nixos/totoro/default.nix index 120ab8f2e3..0d72290bba 100644 --- a/ops/nixos/totoro/default.nix +++ b/ops/nixos/totoro/default.nix @@ -55,7 +55,7 @@ in { services.postgresql.settings.work_mem = "1GB"; services.postgresql.settings.maintenance_work_mem = "1GB"; - nix.maxJobs = lib.mkDefault 8; + nix.settings.max-jobs = lib.mkDefault 8; powerManagement.cpuFreqGovernor = lib.mkDefault "performance"; virtualisation = { podman.enable = true;