Migrate simd.arch to nixos-modules

This commit is contained in:
Sandro - 2023-01-02 17:37:29 +01:00
parent f8bccd8508
commit 42cc20ff5f
Signed by: sandro
GPG Key ID: 3AF5A43A3EECC2E5
7 changed files with 18 additions and 30 deletions

View File

@ -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;
# }
# ];

View File

@ -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" = {

View File

@ -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" = {

View File

@ -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" = {

View File

@ -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" = {

View File

@ -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 <literal>c3d2.users</literal>.
'';
};
};
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 <literal>c3d2.users</literal>.
'';
};
sshKeys = lib.mkOption {

View File

@ -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}" ''