From 42cc20ff5f1c1e230508ac74652d8580562575ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Mon, 2 Jan 2023 17:37:29 +0100 Subject: [PATCH] Migrate simd.arch to nixos-modules --- flake.nix | 2 +- hosts/hydra/default.nix | 7 +++---- hosts/server10/default.nix | 3 ++- hosts/server8/default.nix | 3 ++- hosts/server9/default.nix | 3 ++- modules/c3d2.nix | 28 +++++++--------------------- modules/microvm.nix | 2 +- 7 files changed, 18 insertions(+), 30 deletions(-) diff --git a/flake.nix b/flake.nix index 552298bc..7285f725 100644 --- a/flake.nix +++ b/flake.nix @@ -792,7 +792,7 @@ # (getBuildEntryPoint null (nixosSystem' (nixosSystem.args // (with nixosSystem.args; { # modules = modules ++ [ # { - # # c3d2.simd.enable = lib.mkForce true; + # # simd.enable = lib.mkForce true; # environment.noXlibs = true; # } # ]; diff --git a/hosts/hydra/default.nix b/hosts/hydra/default.nix index 04c4680a..205d5712 100644 --- a/hosts/hydra/default.nix +++ b/hosts/hydra/default.nix @@ -11,10 +11,7 @@ in ../../modules/c3d2.nix ]; - c3d2 = { - hq.statistics.enable = true; - simd.arch = "ivybridge"; - }; + c3d2.hq.statistics.enable = true; boot = { tmpOnTmpfs = true; @@ -244,6 +241,8 @@ in zfs.trim.enable = true; }; + simd.arch = "ivybridge"; + sops = { defaultSopsFile = ./secrets.yaml; secrets."ldap/search-user-pw" = { diff --git a/hosts/server10/default.nix b/hosts/server10/default.nix index 6713d790..98cfc8de 100644 --- a/hosts/server10/default.nix +++ b/hosts/server10/default.nix @@ -10,7 +10,6 @@ c3d2 = { deployment.microvmBaseZfsDataset = "server10/vm"; hq.statistics.enable = true; - simd.arch = "ivybridge"; }; boot = { @@ -51,6 +50,8 @@ }; }; + simd.arch = "ivybridge"; + sops = { defaultSopsFile = ./secrets.yaml; secrets."machine-id" = { diff --git a/hosts/server8/default.nix b/hosts/server8/default.nix index d9354a59..1368e8b0 100644 --- a/hosts/server8/default.nix +++ b/hosts/server8/default.nix @@ -8,7 +8,6 @@ c3d2 = { # deployment.microvmBaseZfsDataset = "tank/storage"; hq.statistics.enable = true; - simd.arch = "westmere"; }; boot = { @@ -38,6 +37,8 @@ zfs.autoScrub.enable = true; }; + simd.arch = "westmere"; + sops = { defaultSopsFile = ./secrets.yaml; secrets."machine-id" = { diff --git a/hosts/server9/default.nix b/hosts/server9/default.nix index b907fd37..f5a440d7 100644 --- a/hosts/server9/default.nix +++ b/hosts/server9/default.nix @@ -8,7 +8,6 @@ _: c3d2 = { deployment.microvmBaseZfsDataset = "tank/storage"; hq.statistics.enable = true; - simd.arch = "westmere"; }; boot = { @@ -45,6 +44,8 @@ _: }; }; + simd.arch = "westmere"; + sops = { defaultSopsFile = ./secrets.yaml; secrets."machine-id" = { diff --git a/modules/c3d2.nix b/modules/c3d2.nix index cfe5189a..60d601fa 100644 --- a/modules/c3d2.nix +++ b/modules/c3d2.nix @@ -65,27 +65,13 @@ in }; }; - nncp = { - neigh = lib.mkOption { - type = with lib.types; attrsOf neighMod; - default = { }; - description = '' - Attrset of NNCP neighbours for relaying packets. - User endpoints go in c3d2.users. - ''; - }; - }; - - simd = { - enable = lib.mkEnableOption "optimized builds with simd instructions"; - arch = lib.mkOption { - type = with lib.types; nullOr str; - default = null; - description = '' - Microarchitecture string for nixpkgs.hostPlatform.gcc.march and to generate system-features. - Can be determined with: gcc -march=native -Q --help=target | grep march - ''; - }; + nncp.neigh = lib.mkOption { + type = with lib.types; attrsOf neighMod; + default = { }; + description = '' + Attrset of NNCP neighbours for relaying packets. + User endpoints go in c3d2.users. + ''; }; sshKeys = lib.mkOption { diff --git a/modules/microvm.nix b/modules/microvm.nix index 8a63c837..69c08b07 100644 --- a/modules/microvm.nix +++ b/modules/microvm.nix @@ -165,7 +165,7 @@ in }) {} nets; }; - c3d2.simd.arch = arch-to-host.${config.c3d2.deployment.server}; + simd.arch = arch-to-host.${config.c3d2.deployment.server}; system.build = { copyToServer = pkgs.writeShellScript "copy-to-${server}" ''