From af3c4b2990000ebda8ab008e0642794c657bfa80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charlotte=20=F0=9F=A6=9D=20Delenk?= Date: Wed, 27 Nov 2024 14:29:27 +0100 Subject: [PATCH] add more gccarch flags to machines --- config/nix.nix | 63 ++++++++++++++++++++++++++++++-------------------- 1 file changed, 38 insertions(+), 25 deletions(-) diff --git a/config/nix.nix b/config/nix.nix index 9007ed95..0a2c0d63 100644 --- a/config/nix.nix +++ b/config/nix.nix @@ -5,7 +5,8 @@ system, attic, ... -}: { +}: +{ imports = [ ./workarounds ]; @@ -13,7 +14,10 @@ nix = { settings = { sandbox = true; - trusted-users = ["@wheel" "remote-build"]; + trusted-users = [ + "@wheel" + "remote-build" + ]; require-sigs = true; substituters = [ "https://attic.chir.rs/chir-rs/" @@ -34,7 +38,8 @@ dates = "weekly"; options = "--delete-older-than 7d"; }; - buildMachines = with lib; + buildMachines = + with lib; mkMerge [ (mkIf (config.networking.hostName != "instance-20221213-1915") [ { @@ -46,7 +51,15 @@ ]; maxJobs = 4; speedFactor = 1; - supportedFeatures = ["nixos-test" "benchmark" "ca-derivations" "gccarch-armv8-a" "gccarch-armv8.1-a" "gccarch-armv8.2-a" "big-parallel"]; + supportedFeatures = [ + "nixos-test" + "benchmark" + "ca-derivations" + "gccarch-armv8-a" + "gccarch-armv8.1-a" + "gccarch-armv8.2-a" + "big-parallel" + ]; } ]) (mkIf (config.networking.hostName != "nas") [ @@ -98,6 +111,7 @@ "big-parallel" "benchmark" "gccarch-skylake-avx512" + "gccarch-znver4" "gccarch-znver3" "gccarch-znver2" "gccarch-znver1" @@ -161,9 +175,7 @@ #!${pkgs.bash}/bin/bash set -ex builds=$(${pkgs.curl}/bin/curl -H 'accept: application/json' https://hydra.int.chir.rs/jobset/flakes/${ - if config.networking.hostName != "vf2" - then "nixos-config" - else "nixos-config-riscv" + if config.networking.hostName != "vf2" then "nixos-config" else "nixos-config-riscv" }/evals | ${pkgs.jq}/bin/jq -r '.evals[0].builds[]') for build in $builds; do doc=$(${pkgs.curl}/bin/curl -H 'accept: application/json' https://hydra.int.chir.rs/build/$build) @@ -175,31 +187,32 @@ ${pkgs.nix}/bin/nix-env -p /nix/var/nix/profiles/system --set $output ${ - if config.networking.hostName != "nixos-8gb-fsn1-1" - then '' - $output/bin/switch-to-configuration boot - booted="$(${pkgs.coreutils}/bin/readlink /run/booted-system/{initrd,kernel,kernel-modules})" - built="$(${pkgs.coreutils}/bin/readlink $output/{initrd,kernel,kernel-modules})" - if [ "$booted" = "$built" ]; then - $output/bin/switch-to-configuration switch - else - ${pkgs.systemd}/bin/shutdown -r +1 - fi - exit - '' - else "$output/bin/switch-to-configuration switch" - } + if config.networking.hostName != "nixos-8gb-fsn1-1" then + '' + $output/bin/switch-to-configuration boot + booted="$(${pkgs.coreutils}/bin/readlink /run/booted-system/{initrd,kernel,kernel-modules})" + built="$(${pkgs.coreutils}/bin/readlink $output/{initrd,kernel,kernel-modules})" + if [ "$booted" = "$built" ]; then + $output/bin/switch-to-configuration switch + else + ${pkgs.systemd}/bin/shutdown -r +1 + fi + exit + '' + else + "$output/bin/switch-to-configuration switch" + } fi done ''; - after = ["network-online.target"]; - wants = ["network-online.target"]; + after = [ "network-online.target" ]; + wants = [ "network-online.target" ]; }; systemd.timers.nixos-upgrade = { enable = true; description = "Automatically update nixos"; - requires = ["nixos-upgrade.service"]; - wantedBy = ["multi-user.target"]; + requires = [ "nixos-upgrade.service" ]; + wantedBy = [ "multi-user.target" ]; timerConfig = { OnUnitActiveSec = "30min"; RandomizedDelaySec = "1h";