Workspace rules (Nixpkgs)

Macros and Functions

check_ghc_version

Example usage (generated)

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

check_ghc_version(
    repository_ctx = None,
)

repository_ctx


haskell_register_ghc_nixpkgs

Register a package from Nixpkgs as a toolchain.

Toolchains can be used to compile Haskell code. To have this toolchain selected during toolchain resolution, set a host platform that includes the @io_tweag_rules_nixpkgs//nixpkgs/constraints:support_nix constraint value.

Examples

haskell_register_ghc_nixpkgs(
    locale_archive = "@glibc_locales//:locale-archive",
    atttribute_path = "haskellPackages.ghc",
    version = "1.2.3",   # The version of GHC
)

Setting the host platform can be done on the command-line like in the following:

--host_platform=@io_tweag_rules_nixpkgs//nixpkgs/platforms:host

Example usage (generated)

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

haskell_register_ghc_nixpkgs(
    version = None,
)

version

name

is_static

Deprecated. The functionality it previously gated (supporting GHC versions with static runtime systems) now sits under static_runtime, a name chosen to avoid confusion with the new flag fully_static_link, which controls support for fully-statically-linked binaries. During the deprecation period, we rewrite is_static to static_runtime in this macro as long as the new attributes aren't also used. This argument and supporting code should be removed in a future release.

static_runtime

True if and only if a static GHC runtime is to be used. This is required in order to use statically-linked Haskell libraries with GHCi and Template Haskell.

True if and only if fully-statically-linked binaries are to be built.

build_file

Passed to nixpkgs_package

build_file_content

Passed to nixpkgs_package

compiler_flags

DEPRECADED. Use new name ghcopts.

ghcopts

A collection of flags that will be passed to GHC

compiler_flags_select

temporary workaround to pass conditional arguments. See https://github.com/bazelbuild/bazel/issues/9199 for details.

haddock_flags

repl_ghci_args

cabalopts

locale_archive

attribute_path

Passed to nixpkgs_package

sh_posix_attributes

List of attribute paths to extract standard Unix shell tools from. Passed to nixpkgs_sh_posix_configure.

nix_file

Passed to nixpkgs_package

nix_file_deps

Passed to nixpkgs_package

nixopts

Passed to nixpkgs_package

locale

repositories

Passed to nixpkgs_package

repository

Passed to nixpkgs_package

nix_file_content

Passed to nixpkgs_package

exec_constraints

target_constraints