From 72bb3fd7b0359e72723eb662298759adba9995cc Mon Sep 17 00:00:00 2001 From: zowoq <59103226+zowoq@users.noreply.github.com> Date: Sat, 12 Oct 2024 14:34:11 +1000 Subject: [PATCH] set gcc.arch, extra-platforms, system-features --- hosts/build01/default.nix | 2 ++ hosts/build02/default.nix | 2 ++ hosts/build03/default.nix | 6 ++++++ hosts/build04/default.nix | 2 ++ modules/nixos/builder.nix | 20 ++++++++++++++++++++ 5 files changed, 32 insertions(+) diff --git a/hosts/build01/default.nix b/hosts/build01/default.nix index d5f608cf0..b2e411fee 100644 --- a/hosts/build01/default.nix +++ b/hosts/build01/default.nix @@ -7,6 +7,8 @@ inputs.self.nixosModules.community-builder ]; + nixpkgs.hostPlatform.gcc.arch = "znver2"; + # Emulate riscv64 until we have proper builders boot.binfmt.emulatedSystems = [ "riscv64-linux" ]; diff --git a/hosts/build02/default.nix b/hosts/build02/default.nix index 2bbc8d974..57ce99140 100644 --- a/hosts/build02/default.nix +++ b/hosts/build02/default.nix @@ -10,6 +10,8 @@ inputs.self.nixosModules.disko-zfs ]; + nixpkgs.hostPlatform.gcc.arch = "znver2"; + # set in srvos, remove when reinstalling networking.hostId = "deadbeef"; diff --git a/hosts/build03/default.nix b/hosts/build03/default.nix index 17e984bc1..2c799ca74 100644 --- a/hosts/build03/default.nix +++ b/hosts/build03/default.nix @@ -16,6 +16,12 @@ ./postgresql.nix ]; + nixpkgs.hostPlatform.gcc.arch = "znver4"; + + nix.settings.extra-platforms = [ + "x86_64-v4-linux" + ]; + systemd.network.networks."10-uplink".networkConfig.Address = "2a01:4f8:2190:2698::2"; system.stateVersion = "23.11"; diff --git a/hosts/build04/default.nix b/hosts/build04/default.nix index c270f6fb1..c777e1344 100644 --- a/hosts/build04/default.nix +++ b/hosts/build04/default.nix @@ -8,6 +8,8 @@ inputs.self.nixosModules.remote-builder ]; + nixpkgs.hostPlatform.gcc.arch = "armv8-a"; + # error: failed to start SSH connection # https://github.com/nix-community/infra/issues/1416 services.openssh.settings.MaxStartups = 100; diff --git a/modules/nixos/builder.nix b/modules/nixos/builder.nix index d6e1061df..9a0173610 100644 --- a/modules/nixos/builder.nix +++ b/modules/nixos/builder.nix @@ -1,12 +1,32 @@ { config, inputs, + lib, pkgs, ... }: { nix.gc.automatic = false; + nixpkgs.hostPlatform = { + inherit (pkgs.hostPlatform) system; + }; + + nix.settings.extra-platforms = lib.mkIf (config.nixpkgs.hostPlatform.system == "x86_64-linux") [ + "i686-linux" + "x86_64-v1-linux" + "x86_64-v2-linux" + "x86_64-v3-linux" + ]; + + nix.settings.system-features = [ + "benchmark" + "big-parallel" + "gccarch-${config.nixpkgs.hostPlatform.gcc.arch}" + "kvm" + "nixos-test" + ]; + systemd.services.free-space = { serviceConfig.Type = "oneshot"; startAt = "hourly";