File tree Expand file tree Collapse file tree 1 file changed +17
-14
lines changed
Expand file tree Collapse file tree 1 file changed +17
-14
lines changed Original file line number Diff line number Diff line change 4545
4646 isNixAtLeast = versionAtLeast ( getVersion nixPackage ) ;
4747
48+ defaultSystemFeatures = [
49+ "nixos-test"
50+ "benchmark"
51+ "big-parallel"
52+ "kvm"
53+ ] ++ optionals ( pkgs . stdenv . hostPlatform ? gcc . arch ) (
54+ # a builder can run code for `gcc.arch` and inferior architectures
55+ [ "gccarch-${ pkgs . stdenv . hostPlatform . gcc . arch } " ]
56+ ++ map ( x : "gccarch-${ x } " ) (
57+ systems . architectures . inferiors . ${ pkgs . stdenv . hostPlatform . gcc . arch } or [ ]
58+ )
59+ ) ;
60+
4861 legacyConfMappings = {
4962 useSandbox = "sandbox" ;
5063 buildCores = "cores" ;
315328
316329 system-features = mkOption {
317330 type = types . listOf types . str ;
318- default =
319- [
320- "nixos-test"
321- "benchmark"
322- "big-parallel"
323- "kvm"
324- ]
325- ++ optionals ( pkgs . stdenv . hostPlatform ? gcc . arch ) (
326- # a builder can run code for `gcc.arch` and inferior architectures
327- [ "gccarch-${ pkgs . stdenv . hostPlatform . gcc . arch } " ]
328- ++ map ( x : "gccarch-${ x } " ) (
329- systems . architectures . inferiors . ${ pkgs . stdenv . hostPlatform . gcc . arch } or [ ]
330- )
331- ) ;
331+ # We expose system-featuers here and in config below.
332+ # This allows users to access the default value via `options.nix.settings.system-features`
333+ default = defaultSystemFeatures ;
332334 defaultText = literalExpression ''[ "nixos-test" "benchmark" "big-parallel" "kvm" "gccarch-<arch>" ]'' ;
333335 description = ''
334336 The set of features supported by the machine. Derivations
385387 trusted-public-keys = [ "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" ] ;
386388 trusted-users = [ "root" ] ;
387389 substituters = mkAfter [ "https://cache.nixos.org/" ] ;
390+ system-features = defaultSystemFeatures ;
388391 } ;
389392 } ;
390393}
You can’t perform that action at this time.
0 commit comments