From 6e6a7061ff2e92a8ff8d39fd6dfb6f3b197b1adc Mon Sep 17 00:00:00 2001 From: Mathieu Boespflug Date: Sun, 19 Apr 2020 14:58:41 +0200 Subject: [PATCH] Define Nix-enabled platform Like bazelbuild/rules_docker, we define a Nix-enabled platform with `@local_config_platform//:host` as the parent platform. Deprecates `linux_x86_64_nixpkgs` and `darwin_x86_64_nixpkgs`. --- .bazelrc | 2 +- nixpkgs/constraints/BUILD.bazel | 2 ++ nixpkgs/platforms/BUILD.bazel | 6 ++++++ 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 nixpkgs/platforms/BUILD.bazel diff --git a/.bazelrc b/.bazelrc index 99765694f..d226e65e2 100644 --- a/.bazelrc +++ b/.bazelrc @@ -1 +1 @@ -build --host_platform=@io_tweag_rules_nixpkgs//nixpkgs/constraints:linux_x86_64_nixpkgs +build --host_platform=@io_tweag_rules_nixpkgs//nixpkgs/platforms:host diff --git a/nixpkgs/constraints/BUILD.bazel b/nixpkgs/constraints/BUILD.bazel index 36fb41f3d..66625309b 100644 --- a/nixpkgs/constraints/BUILD.bazel +++ b/nixpkgs/constraints/BUILD.bazel @@ -20,6 +20,7 @@ platform( "@platforms//os:linux", "@io_tweag_rules_nixpkgs//nixpkgs/constraints:nixpkgs", ], + deprecation = "Use @io_tweag_rules_nixpkgs//platforms:host instead.", visibility = ["//visibility:public"], ) @@ -30,5 +31,6 @@ platform( "@platforms//os:osx", "@io_tweag_rules_nixpkgs//nixpkgs/constraints:nixpkgs", ], + deprecation = "Use @io_tweag_rules_nixpkgs//platforms:host instead.", visibility = ["//visibility:public"], ) diff --git a/nixpkgs/platforms/BUILD.bazel b/nixpkgs/platforms/BUILD.bazel new file mode 100644 index 000000000..d574b24c6 --- /dev/null +++ b/nixpkgs/platforms/BUILD.bazel @@ -0,0 +1,6 @@ +platform( + name = "host", + constraint_values = ["@io_tweag_rules_nixpkgs//nixpkgs/constraints:support_nix"], + parents = ["@local_config_platform//:host"], + visibility = ["//visibility:public"], +)