Unverified Commit 611bfa1d authored by Jörg Thalheim's avatar Jörg Thalheim Committed by GitHub
Browse files

make nix.settings.system-features default mergeable again (#383052)

parents abd72d8e 7b912bca
Loading
Loading
Loading
Loading
+17 −14
Original line number Diff line number Diff line
@@ -45,6 +45,19 @@ let

  isNixAtLeast = versionAtLeast (getVersion nixPackage);

  defaultSystemFeatures = [
    "nixos-test"
    "benchmark"
    "big-parallel"
    "kvm"
  ] ++ optionals (pkgs.stdenv.hostPlatform ? gcc.arch) (
      # a builder can run code for `gcc.arch` and inferior architectures
      [ "gccarch-${pkgs.stdenv.hostPlatform.gcc.arch}" ]
      ++ map (x: "gccarch-${x}") (
        systems.architectures.inferiors.${pkgs.stdenv.hostPlatform.gcc.arch} or [ ]
      )
    );

  legacyConfMappings = {
    useSandbox = "sandbox";
    buildCores = "cores";
@@ -315,20 +328,9 @@ in

            system-features = mkOption {
              type = types.listOf types.str;
              default =
                [
                  "nixos-test"
                  "benchmark"
                  "big-parallel"
                  "kvm"
                ]
                ++ optionals (pkgs.stdenv.hostPlatform ? gcc.arch) (
                  # a builder can run code for `gcc.arch` and inferior architectures
                  [ "gccarch-${pkgs.stdenv.hostPlatform.gcc.arch}" ]
                  ++ map (x: "gccarch-${x}") (
                    systems.architectures.inferiors.${pkgs.stdenv.hostPlatform.gcc.arch} or [ ]
                  )
                );
              # We expose system-featuers here and in config below.
              # This allows users to access the default value via `options.nix.settings.system-features`
              default = defaultSystemFeatures;
              defaultText = literalExpression ''[ "nixos-test" "benchmark" "big-parallel" "kvm" "gccarch-<arch>" ]'';
              description = ''
                The set of features supported by the machine. Derivations
@@ -385,6 +387,7 @@ in
      trusted-public-keys = [ "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" ];
      trusted-users = [ "root" ];
      substituters = mkAfter [ "https://cache.nixos.org/" ];
      system-features = defaultSystemFeatures;
    };
  };
}