set gcc.arch, extra-platforms, system-features

This commit is contained in:
zowoq 2024-10-12 14:34:11 +10:00
parent 25e81d251e
commit 0aa0c25db1
6 changed files with 34 additions and 0 deletions
modules/nixos/common

View file

@ -19,6 +19,30 @@
script = builtins.readFile "${inputs.self}/modules/shared/free-space.bash";
};
nixpkgs.hostPlatform = {
inherit (pkgs.hostPlatform) system;
};
nix.settings.extra-platforms = lib.mkIf (config.nixpkgs.hostPlatform.system == "x86_64-linux") [
(lib.mkIf (config.boot.binfmt.emulatedSystems == [ ]) "i686-linux")
"x86_64-v1-linux"
"x86_64-v2-linux"
"x86_64-v3-linux"
(lib.mkIf (builtins.elem "gccarch-x86-64-v4" config.nix.settings.system-features) "x86_64-v4-linux")
];
nix.settings.system-features =
[
"benchmark"
"big-parallel"
"kvm"
"nixos-test"
"gccarch-${config.nixpkgs.hostPlatform.gcc.arch}"
]
++ map (x: "gccarch-${x}") (
lib.systems.architectures.inferiors.${config.nixpkgs.hostPlatform.gcc.arch} or [ ]
);
# Bump the open files limit so that non-root users can run NixOS VM tests
security.pam.loginLimits = [
{