ops/nixos: migrate nix.maxJobs/binaryCaches/trustedBinaryCaches to the nix.settings equivalents

This commit is contained in:
Luke Granger-Brown 2022-01-30 20:30:20 +00:00
parent 14a8bd4945
commit cbabb6f211
11 changed files with 19 additions and 15 deletions

View file

@ -119,8 +119,10 @@ in {
]; ];
networking.hosts = depot.ops.nixos.tailscaleIPs; networking.hosts = depot.ops.nixos.tailscaleIPs;
nix = { nix = {
binaryCaches = lib.mkForce [ "https://cache.nixos.org/" "s3://lukegb-nix-cache?endpoint=storage.googleapis.com&trusted=1" ]; settings = {
trustedBinaryCaches = lib.mkForce [ "https://cache.nixos.org/" "s3://lukegb-nix-cache?endpoint=storage.googleapis.com&trusted=1" ]; 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 = { envVars = {
AWS_ACCESS_KEY_ID = "${depot.ops.secrets.nixCache.AWS_ACCESS_KEY_ID}"; AWS_ACCESS_KEY_ID = "${depot.ops.secrets.nixCache.AWS_ACCESS_KEY_ID}";
AWS_SECRET_ACCESS_KEY = "${depot.ops.secrets.nixCache.AWS_SECRET_ACCESS_KEY}"; AWS_SECRET_ACCESS_KEY = "${depot.ops.secrets.nixCache.AWS_SECRET_ACCESS_KEY}";

View file

@ -86,7 +86,7 @@ in {
}; };
}; };
nix.maxJobs = lib.mkDefault 12; nix.settings.max-jobs = lib.mkDefault 12;
# Use systemd-boot. # Use systemd-boot.
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;

View file

@ -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. # Use GRUB, so we can have mirrored bootloaders.
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;

View file

@ -109,7 +109,7 @@ in {
}; };
}; };
nix.maxJobs = lib.mkDefault 8; nix.settings.max-jobs = lib.mkDefault 8;
# Networking! # Networking!
networking = { networking = {

View file

@ -51,7 +51,7 @@ in {
}; };
}; };
nix.maxJobs = lib.mkDefault 12; nix.settings.max-jobs = lib.mkDefault 12;
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.enableRedistributableFirmware = true; hardware.enableRedistributableFirmware = true;

View file

@ -43,7 +43,7 @@
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;
nix.maxJobs = lib.mkDefault 2; nix.settings.max-jobs = lib.mkDefault 2;
my.rundeck.tags = [ "bvm" ]; my.rundeck.tags = [ "bvm" ];

View file

@ -101,11 +101,13 @@ in
my.rundeck.tags = [ "nixos" ]; my.rundeck.tags = [ "nixos" ];
nix = { nix = {
nixPath = [ "depot=/home/lukegb/depot/" "nixpkgs=/home/lukegb/depot/third_party/nixpkgs/" ];
package = pkgs.nix_2_3; # Use a working nix. package = pkgs.nix_2_3; # Use a working nix.
trustedUsers = [ "root" "@wheel" "deployer" ]; nixPath = [ "depot=/home/lukegb/depot/" "nixpkgs=/home/lukegb/depot/third_party/nixpkgs/" ];
binaryCaches = lib.mkForce [ "https://cache.nixos.org/" "s3://lukegb-nix-cache?endpoint=storage.googleapis.com&trusted=1" ]; settings = {
trustedBinaryCaches = lib.mkForce [ "https://cache.nixos.org/" "s3://lukegb-nix-cache?endpoint=storage.googleapis.com&trusted=1" ]; 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 = { envVars = {
AWS_ACCESS_KEY_ID = "${depot.ops.secrets.nixCache.AWS_ACCESS_KEY_ID}"; AWS_ACCESS_KEY_ID = "${depot.ops.secrets.nixCache.AWS_ACCESS_KEY_ID}";
AWS_SECRET_ACCESS_KEY = "${depot.ops.secrets.nixCache.AWS_SECRET_ACCESS_KEY}"; AWS_SECRET_ACCESS_KEY = "${depot.ops.secrets.nixCache.AWS_SECRET_ACCESS_KEY}";

View file

@ -36,7 +36,7 @@ in {
}; };
}; };
nix.maxJobs = lib.mkDefault 1; nix.settings.max-jobs = lib.mkDefault 1;
# Networking! # Networking!
networking = { networking = {

View file

@ -73,7 +73,7 @@ in {
}; };
}; };
nix.maxJobs = lib.mkDefault 12; nix.settings.max-jobs = lib.mkDefault 12;
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.enableRedistributableFirmware = true; hardware.enableRedistributableFirmware = true;

View file

@ -30,7 +30,7 @@ in {
}; };
}; };
nix.maxJobs = lib.mkDefault 4; nix.settings.max-jobs = lib.mkDefault 4;
# Use the systemd-boot EFI boot loader. # Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;

View file

@ -55,7 +55,7 @@ in {
services.postgresql.settings.work_mem = "1GB"; services.postgresql.settings.work_mem = "1GB";
services.postgresql.settings.maintenance_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"; powerManagement.cpuFreqGovernor = lib.mkDefault "performance";
virtualisation = { virtualisation = {
podman.enable = true; podman.enable = true;