Skip to content

Commit

Permalink
Upgrade rules_nixpkgs to 0.11.1
Browse files Browse the repository at this point in the history
rules_haskell 0.19 depends on rules_nixpkgs 0.10, but we need the fix
tweag/rules_nixpkgs#421 to avoid error:

```
panic: rulesGoStdlibPrefix should have been set via -X
```

Also, load only the needed toolchain rules from rules_nixpkgs.
  • Loading branch information
avdv committed May 18, 2024
1 parent fea6177 commit 77a1eda
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
30 changes: 29 additions & 1 deletion WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")

bazel_skylib_workspace()

http_archive(
name = "io_tweag_rules_nixpkgs",
sha256 = "2a555348d7f8593fca2bf3fc6ce53c5d62929de81b6c292e23f16c557c0ae45a",
strip_prefix = "rules_nixpkgs-0.11.1",
urls = ["https://github.com/tweag/rules_nixpkgs/releases/download/v0.11.1/rules_nixpkgs-0.11.1.tar.gz"],
)

# Download rules_haskell and make it accessible as "@rules_haskell".
http_archive(
name = "rules_haskell",
Expand All @@ -40,6 +47,21 @@ load("@rules_sh//sh:posix.bzl", "sh_posix_configure")
# Bring in a "local" toolchain - (only hermetic if in a pure nix-shell!)
sh_posix_configure()

# Add rules_nixpkgs toolchains
load(
"@io_tweag_rules_nixpkgs//nixpkgs:repositories.bzl",
"rules_nixpkgs_dependencies",
)

rules_nixpkgs_dependencies(
toolchains = [
"cc",
"go",
"python",
"posix",
],
)

load(
"@rules_haskell//haskell:repositories.bzl",
"rules_haskell_dependencies",
Expand All @@ -51,9 +73,15 @@ rules_haskell_dependencies()
# Load nixpkgs_git_repository from rules_nixpkgs,
# which was already initialized by rules_haskell_dependencies above.
load(
"@io_tweag_rules_nixpkgs//nixpkgs:nixpkgs.bzl",
"@rules_nixpkgs_cc//:cc.bzl",
"nixpkgs_cc_configure",
)
load(
"@rules_nixpkgs_core//:nixpkgs.bzl",
"nixpkgs_local_repository",
)
load(
"@rules_nixpkgs_python//:python.bzl",
"nixpkgs_python_configure",
)

Expand Down
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
nativeBuildInputs = nativeBuildInputs ++ [ ghc ];

fetchAttrs = {
sha256 = "sha256-ZyP1umO8wqcwEaP5tYCtGDGfCztK3naZmmrWx/rGBao=";
sha256 = "sha256-u2bC9SUJEJd4RCrnZhIRKtLcyesyxe94hnwsBI8+3s4=";
};

buildAttrs = {
Expand Down

0 comments on commit 77a1eda

Please sign in to comment.