diff options
author | Michael Raskin <7c6f434c@mail.ru> | 2019-05-05 19:12:12 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-05 19:12:12 +0000 |
commit | 7770495cd7c6431bd4b1ac6eadbae4e51479538b (patch) | |
tree | ae6489d5293cb1c74834db045accaa0dff9fdf15 /nixos/modules | |
parent | 24debf74ef5c6e7799a5bc7edc4b2d6eae8e3c07 (diff) | |
parent | 091de095c92ab1d2932ec9dd5e810ea2575e2432 (diff) | |
download | nixlib-7770495cd7c6431bd4b1ac6eadbae4e51479538b.tar nixlib-7770495cd7c6431bd4b1ac6eadbae4e51479538b.tar.gz nixlib-7770495cd7c6431bd4b1ac6eadbae4e51479538b.tar.bz2 nixlib-7770495cd7c6431bd4b1ac6eadbae4e51479538b.tar.lz nixlib-7770495cd7c6431bd4b1ac6eadbae4e51479538b.tar.xz nixlib-7770495cd7c6431bd4b1ac6eadbae4e51479538b.tar.zst nixlib-7770495cd7c6431bd4b1ac6eadbae4e51479538b.zip |
Merge pull request #59148 from volth/gcc.arch.v3
compilation for particular x86_64 architecture
Diffstat (limited to 'nixos/modules')
-rw-r--r-- | nixos/modules/services/misc/nix-daemon.nix | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/nixos/modules/services/misc/nix-daemon.nix b/nixos/modules/services/misc/nix-daemon.nix index 665215822af8..fe68879fda9d 100644 --- a/nixos/modules/services/misc/nix-daemon.nix +++ b/nixos/modules/services/misc/nix-daemon.nix @@ -60,6 +60,7 @@ let ${optionalString (isNix20 && !cfg.distributedBuilds) '' builders = ''} + system-features = ${toString cfg.systemFeatures} $extraOptions END '' + optionalString cfg.checkConfig ( @@ -360,6 +361,14 @@ in ''; }; + systemFeatures = mkOption { + type = types.listOf types.str; + example = [ "kvm" "big-parallel" "gccarch-skylake" ]; + description = '' + The supported features of a machine + ''; + }; + checkConfig = mkOption { type = types.bool; default = true; @@ -478,6 +487,21 @@ in /nix/var/nix/gcroots/tmp ''; + nix.systemFeatures = mkDefault ( + [ "nixos-test" "benchmark" "big-parallel" "kvm" ] ++ + optionals (pkgs.stdenv.isx86_64 && pkgs.hostPlatform.platform ? gcc.arch) ( + # a x86_64 builder can run code for `platform.gcc.arch` and minor architectures: + [ "gccarch-${pkgs.hostPlatform.platform.gcc.arch}" ] ++ { + "sandybridge" = [ "gccarch-westmere" ]; + "ivybridge" = [ "gccarch-westmere" "gccarch-sandybridge" ]; + "haswell" = [ "gccarch-westmere" "gccarch-sandybridge" "gccarch-ivybridge" ]; + "broadwell" = [ "gccarch-westmere" "gccarch-sandybridge" "gccarch-ivybridge" "gccarch-haswell" ]; + "skylake" = [ "gccarch-westmere" "gccarch-sandybridge" "gccarch-ivybridge" "gccarch-haswell" "gccarch-broadwell" ]; + "skylake-avx512" = [ "gccarch-westmere" "gccarch-sandybridge" "gccarch-ivybridge" "gccarch-haswell" "gccarch-broadwell" "gccarch-skylake" ]; + }.${pkgs.hostPlatform.platform.gcc.arch} + ) + ); + }; } |