third_party/linux: ignore more configuration settings

Change-Id: Id1117d86d742a94f762f186e6c1f9193dc4e0597
Reviewed-on: https://review.monogon.dev/c/monogon/+/1829
Tested-by: Jenkins CI
Reviewed-by: Lorenz Brun <lorenz@monogon.tech>
diff --git a/third_party/linux/def.bzl b/third_party/linux/def.bzl
index 2090ed9..885e329 100644
--- a/third_party/linux/def.bzl
+++ b/third_party/linux/def.bzl
@@ -26,19 +26,26 @@
 load("//build/utils:detect_root.bzl", "detect_root")
 
 
+_new_settings = {
+    # This list should be expanded with any configuration options that end
+    # up reaching this rule with different values across different build
+    # graph paths, but that do not actually influence the kernel build.
+    # Force-setting them to a stable value forces the build configuration
+    # to a stable hash.
+    # See the transition's comment block for more information.
+    "@io_bazel_rules_go//go/config:pure": True,
+    "@io_bazel_rules_go//go/config:static": True,
+
+    "@io_bazel_rules_docker//platforms:image_transition_cpu": "@platforms//cpu:x86_64",
+    "@io_bazel_rules_docker//platforms:image_transition_os": "@platforms//os:linux",
+
+    # Note: this toolchain is not actually used to perform the build.
+    "//command_line_option:platforms": "//build/platforms:linux_amd64_static",
+}
+
+
 def _ignore_unused_configuration_impl(settings, attr):
-    return {
-        # This list should be expanded with any configuration options that end
-        # up reaching this rule with different values across different build
-        # graph paths, but that do not actually influence the kernel build.
-        # Force-setting them to a stable value forces the build configuration
-        # to a stable hash.
-        # See the transition's comment block for more information.
-        "@io_bazel_rules_go//go/config:pure": True,
-        "@io_bazel_rules_go//go/config:static": True,
-        # Note: this toolchain is not actually used to perform the build.
-        "//command_line_option:platforms": "//build/platforms:linux_amd64_static",
-    }
+    return _new_settings
 
 # Transition to flip all known-unimportant but varying configuration options to
 # a known, stable value.
@@ -53,11 +60,7 @@
 ignore_unused_configuration = transition(
     implementation = _ignore_unused_configuration_impl,
     inputs = [],
-    outputs = [
-        "@io_bazel_rules_go//go/config:pure",
-        "@io_bazel_rules_go//go/config:static",
-        "//command_line_option:platforms",
-    ],
+    outputs = list(_new_settings.keys()),
 )