Skip to content

Commit

Permalink
Fix nixpkgs GHC version
Browse files Browse the repository at this point in the history
  • Loading branch information
avdv committed Dec 5, 2024
1 parent 25afe6e commit 6238884
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 24 deletions.
8 changes: 5 additions & 3 deletions examples/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,17 @@ rules_haskell_dependencies()

load("@rules_haskell//haskell:nixpkgs.bzl", "haskell_register_ghc_nixpkgs")

GHC_VERSION = "9.4.8"

haskell_register_ghc_nixpkgs(
attribute_path = "haskell.compiler.ghc946",
attribute_path = "haskell.compiler.ghc{}".format(GHC_VERSION.replace(".", "")),
repository = "@rules_haskell//nixpkgs:default.nix",
version = "9.4.8",
version = GHC_VERSION,
)

load("@rules_haskell//haskell:toolchain.bzl", "rules_haskell_toolchains")

rules_haskell_toolchains(version = "9.4.8")
rules_haskell_toolchains(version = GHC_VERSION)

load("@rules_nixpkgs_cc//:cc.bzl", "nixpkgs_cc_configure")
load("@rules_nixpkgs_python//:python.bzl", "nixpkgs_python_configure")
Expand Down
6 changes: 4 additions & 2 deletions rules_haskell_nix/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,14 @@ nix_haskell_toolchains = use_extension(
"nix_haskell_toolchains",
)

GHC_VERSION = "9.4.8"

# Declare a default nix-based toolchain
nix_haskell_toolchains.new(
attribute_path = "",
nix_file_content = """with import <nixpkgs> {}; haskell.packages.ghc946.ghc""",
nix_file_content = "with import <nixpkgs> {{}}; haskell.packages.ghc{}.ghc".format(GHC_VERSION.replace(".", "")),
repository = "@nixpkgs_default",
version = "9.4.8",
version = GHC_VERSION,
)
use_repo(
nix_haskell_toolchains,
Expand Down
2 changes: 1 addition & 1 deletion rules_haskell_tests/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ nix_haskell_toolchains.new(
cabalopts = test_cabalopts,
ghcopts = test_ghcopts,
haddock_flags = test_haddock_flags,
nix_file_content = """with import <nixpkgs> {}; haskell.packages.ghc946.ghc""",
nix_file_content = "with import <nixpkgs> {{}}; haskell.packages.ghc{}.ghc".format(test_ghc_version.replace(".", "")),
repl_ghci_args = test_repl_ghci_args,
repository = "@nixpkgs_default",
version = test_ghc_version,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,17 @@ rules_haskell_dependencies()

load("@rules_haskell//haskell:nixpkgs.bzl", "haskell_register_ghc_nixpkgs")

GHC_VERSION = "9.4.8"

haskell_register_ghc_nixpkgs(
attribute_path = "haskell.compiler.ghc946",
attribute_path = "haskell.compiler.ghc{}".format(GHC_VERSION.replace(".", "")),
repository = "@rules_haskell//nixpkgs:default.nix",
version = "9.4.8",
version = GHC_VERSION,
)

load("@rules_haskell//haskell:toolchain.bzl", "rules_haskell_toolchains")

rules_haskell_toolchains(version = "9.4.8")
rules_haskell_toolchains(version = GHC_VERSION)

load("@rules_nixpkgs_cc//:cc.bzl", "nixpkgs_cc_configure")
load(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,18 @@ rules_haskell_dependencies()

load("@rules_haskell//haskell:nixpkgs.bzl", "haskell_register_ghc_nixpkgs")


GHC_VERSION = "9.4.8"

haskell_register_ghc_nixpkgs(
attribute_path = "haskell.compiler.ghc946",
attribute_path = "haskell.compiler.ghc{}".format(GHC_VERSION.replace(".", "")),
repository = "@rules_haskell//nixpkgs:default.nix",
version = "9.4.8",
version = GHC_VERSION,
)

load("@rules_haskell//haskell:toolchain.bzl", "rules_haskell_toolchains")

rules_haskell_toolchains(version = "9.4.8")
rules_haskell_toolchains(version = GHC_VERSION)

load(
"@io_tweag_rules_nixpkgs//nixpkgs:nixpkgs.bzl",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@ rules_haskell_dependencies()

load("@rules_haskell//haskell:nixpkgs.bzl", "haskell_register_ghc_nixpkgs")

GHC_VERSION = "9.4.8"

haskell_register_ghc_nixpkgs(
attribute_path = "haskell.compiler.ghc946",
attribute_path = "haskell.compiler.ghc{}".format(GHC_VERSION.replace(".", "")),
repository = "@rules_haskell//nixpkgs:default.nix",
version = "9.4.8",
version = GHC_VERSION,
)

load("@rules_haskell//haskell:toolchain.bzl", "rules_haskell_toolchains")

rules_haskell_toolchains(version = "9.4.8")
rules_haskell_toolchains(version = GHC_VERSION)

load(
"@io_tweag_rules_nixpkgs//nixpkgs:nixpkgs.bzl",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,17 @@ rules_haskell_dependencies()

load("@rules_haskell//haskell:nixpkgs.bzl", "haskell_register_ghc_nixpkgs")

GHC_VERSION = "9.4.8"

haskell_register_ghc_nixpkgs(
attribute_path = "haskell.compiler.ghc946",
attribute_path = "haskell.compiler.ghc{}".format(GHC_VERSION.replace(".", "")),
repository = "@rules_haskell//nixpkgs:default.nix",
version = "9.4.8",
version = GHC_VERSION,
)

load("@rules_haskell//haskell:toolchain.bzl", "rules_haskell_toolchains")

rules_haskell_toolchains(version = "9.4.8")
rules_haskell_toolchains(version = GHC_VERSION)

load(
"@io_tweag_rules_nixpkgs//nixpkgs:nixpkgs.bzl",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@ rules_haskell_dependencies()

load("@rules_haskell//haskell:nixpkgs.bzl", "haskell_register_ghc_nixpkgs")

GHC_VERSION = "9.4.8"

haskell_register_ghc_nixpkgs(
attribute_path = "haskell.compiler.ghc946",
attribute_path = "haskell.compiler.ghc{}".format(GHC_VERSION.replace(".", "")),
repository = "@rules_haskell//nixpkgs:default.nix",
version = "9.4.8",
version = GHC_VERSION,
)

load("@rules_haskell//haskell:toolchain.bzl", "rules_haskell_toolchains")

rules_haskell_toolchains(version = "9.4.8")
rules_haskell_toolchains(version = GHC_VERSION)

load(
"@io_tweag_rules_nixpkgs//nixpkgs:nixpkgs.bzl",
Expand Down
8 changes: 5 additions & 3 deletions tutorial/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,17 @@ rules_haskell_dependencies()

load("@rules_haskell//haskell:nixpkgs.bzl", "haskell_register_ghc_nixpkgs")

GHC_VERSION = "9.4.8"

haskell_register_ghc_nixpkgs(
attribute_path = "haskell.compiler.ghc946",
attribute_path = "haskell.compiler.ghc{}".format(GHC_VERSION.replace(".", "")),
repository = "@rules_haskell//nixpkgs:default.nix",
version = "9.4.8",
version = GHC_VERSION,
)

load("@rules_haskell//haskell:toolchain.bzl", "rules_haskell_toolchains")

rules_haskell_toolchains(version = "9.4.8")
rules_haskell_toolchains(version = GHC_VERSION)

load(
"@io_tweag_rules_nixpkgs//nixpkgs:nixpkgs.bzl",
Expand Down

0 comments on commit 6238884

Please sign in to comment.