diff --git a/example/MODULE.bazel b/example/MODULE.bazel index 9f1cde3..a5fa534 100644 --- a/example/MODULE.bazel +++ b/example/MODULE.bazel @@ -5,20 +5,8 @@ local_path_override(module_name = "gazelle_cabal", path = "..") bazel_dep(name = "rules_haskell") bazel_dep(name = "rules_haskell_nix") -RULES_HASKELL_REV = "155ba21c7d315cc421ee3f17a1c09b758cc7279d" -RULES_HASKELL_INTEGRITY = "sha384-dIsFufYml0KGSUiC6jhY9ClMv/yEW1kGof7fLahSwfbWd28jLiwMGBGUuoOsQwWf" -archive_override( - module_name = "rules_haskell", - urls = ["https://github.com/tweag/rules_haskell/archive/%s.tar.gz" % RULES_HASKELL_REV], - strip_prefix = "rules_haskell-%s" % RULES_HASKELL_REV, - integrity = RULES_HASKELL_INTEGRITY, -) -archive_override( - module_name = "rules_haskell_nix", - urls = ["https://github.com/tweag/rules_haskell/archive/%s.tar.gz" % RULES_HASKELL_REV], - strip_prefix = "rules_haskell-%s/rules_haskell_nix" % RULES_HASKELL_REV, - integrity = RULES_HASKELL_INTEGRITY, -) +bazel_dep(name = "rules_go", version = "0.41.0", repo_name = "io_bazel_rules_go") +bazel_dep(name = "gazelle", version = "0.33.0", repo_name = "bazel_gazelle") stack_snapshots = use_extension( "@rules_haskell//extensions:stack_snapshot.bzl", @@ -41,33 +29,7 @@ stack_snapshots.package(name = "tasty-hunit") stack_snapshots.package(name = "text") stack_snapshots.package(name = "void") -bazel_dep(name = "rules_nixpkgs_core") -bazel_dep(name = "rules_nixpkgs_cc") -bazel_dep(name = "rules_nixpkgs_posix") -RULES_NIXPKGS_REV = "7e627d76ba65d6c42586fc265e46bd370672b4eb" -RULES_NIXPKGS_INTEGRITY = "sha384-N2bS5BvSk8QMjhmuxdeeve9PBJUTwFOHufMV4sDgaviwXNdCGc7JaJPqwqZV1TbC" -archive_override( - module_name = "rules_nixpkgs_core", - urls = ["https://github.com/tweag/rules_nixpkgs/archive/%s.tar.gz" % RULES_NIXPKGS_REV], - strip_prefix = "rules_nixpkgs-%s/core" % RULES_NIXPKGS_REV, - integrity = RULES_NIXPKGS_INTEGRITY, -) -archive_override( - module_name = "rules_nixpkgs_cc", - urls = ["https://github.com/tweag/rules_nixpkgs/archive/%s.tar.gz" % RULES_NIXPKGS_REV], - strip_prefix = "rules_nixpkgs-%s/toolchains/cc" % RULES_NIXPKGS_REV, - integrity = RULES_NIXPKGS_INTEGRITY, -) -archive_override( - module_name = "rules_nixpkgs_posix", - urls = ["https://github.com/tweag/rules_nixpkgs/archive/%s.tar.gz" % RULES_NIXPKGS_REV], - strip_prefix = "rules_nixpkgs-%s/toolchains/posix" % RULES_NIXPKGS_REV, - integrity = RULES_NIXPKGS_INTEGRITY, -) - -bazel_dep(name = "rules_go", version = "0.41.0", repo_name = "io_bazel_rules_go") -bazel_dep(name = "gazelle", version = "0.33.0", repo_name = "bazel_gazelle") - +# TODO replace this once a proper public interface for Nix provided Haskell toolchains exists. nix_haskell_toolchains = use_extension( "@rules_haskell_nix//extensions:nix_haskell_toolchains.bzl", "nix_haskell_toolchains", @@ -101,10 +63,52 @@ register_toolchains( "@all_posix_toolchains//:all", ) +# TODO Remove once rules_haskell is in the BCR. +RULES_HASKELL_REV = "155ba21c7d315cc421ee3f17a1c09b758cc7279d" +RULES_HASKELL_INTEGRITY = "sha384-dIsFufYml0KGSUiC6jhY9ClMv/yEW1kGof7fLahSwfbWd28jLiwMGBGUuoOsQwWf" +archive_override( + module_name = "rules_haskell", + urls = ["https://github.com/tweag/rules_haskell/archive/%s.tar.gz" % RULES_HASKELL_REV], + strip_prefix = "rules_haskell-%s" % RULES_HASKELL_REV, + integrity = RULES_HASKELL_INTEGRITY, +) +archive_override( + module_name = "rules_haskell_nix", + urls = ["https://github.com/tweag/rules_haskell/archive/%s.tar.gz" % RULES_HASKELL_REV], + strip_prefix = "rules_haskell-%s/rules_haskell_nix" % RULES_HASKELL_REV, + integrity = RULES_HASKELL_INTEGRITY, +) + # Needed for custom toolchain definitions in non_module_deps. +# TODO update once a bzlmod API for Nix provided toolchains exists. +bazel_dep(name = "rules_nixpkgs_core") +bazel_dep(name = "rules_nixpkgs_cc") +bazel_dep(name = "rules_nixpkgs_posix") bazel_dep(name = "platforms", version = "0.0.7") bazel_dep(name = "rules_cc", version = "0.0.9") +# TODO Remove once rules_nixpkgs is in the BCR. +RULES_NIXPKGS_REV = "7e627d76ba65d6c42586fc265e46bd370672b4eb" +RULES_NIXPKGS_INTEGRITY = "sha384-N2bS5BvSk8QMjhmuxdeeve9PBJUTwFOHufMV4sDgaviwXNdCGc7JaJPqwqZV1TbC" +archive_override( + module_name = "rules_nixpkgs_core", + urls = ["https://github.com/tweag/rules_nixpkgs/archive/%s.tar.gz" % RULES_NIXPKGS_REV], + strip_prefix = "rules_nixpkgs-%s/core" % RULES_NIXPKGS_REV, + integrity = RULES_NIXPKGS_INTEGRITY, +) +archive_override( + module_name = "rules_nixpkgs_cc", + urls = ["https://github.com/tweag/rules_nixpkgs/archive/%s.tar.gz" % RULES_NIXPKGS_REV], + strip_prefix = "rules_nixpkgs-%s/toolchains/cc" % RULES_NIXPKGS_REV, + integrity = RULES_NIXPKGS_INTEGRITY, +) +archive_override( + module_name = "rules_nixpkgs_posix", + urls = ["https://github.com/tweag/rules_nixpkgs/archive/%s.tar.gz" % RULES_NIXPKGS_REV], + strip_prefix = "rules_nixpkgs-%s/toolchains/posix" % RULES_NIXPKGS_REV, + integrity = RULES_NIXPKGS_INTEGRITY, +) + non_module_deps = use_extension("//:non_module_deps.bzl", "non_module_deps") use_repo(non_module_deps, "nixpkgs") use_repo(non_module_deps, "nixpkgs_config_cc")