Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I use the MODULE.bazel mechanism to use flakes? #592

Open
blockjon-dd opened this issue Sep 18, 2024 · 0 comments
Open

How do I use the MODULE.bazel mechanism to use flakes? #592

blockjon-dd opened this issue Sep 18, 2024 · 0 comments

Comments

@blockjon-dd
Copy link

blockjon-dd commented Sep 18, 2024

How do I convert this WORKSPACE style to MODULE.bazel style?

WORKSPACE.bzlmod

http_archive(
    name = "io_tweag_rules_nixpkgs",
    sha256 = "1adb04dc0416915fef427757f4272c4f7dacefeceeefc50f683aec7f7e9b787a",
    strip_prefix = "rules_nixpkgs-0.12.0",
    urls = ["https://github.com/tweag/rules_nixpkgs/releases/download/v0.12.0/rules_nixpkgs-0.12.0.tar.gz"],
)

load("@io_tweag_rules_nixpkgs//nixpkgs:repositories.bzl", "rules_nixpkgs_dependencies")
rules_nixpkgs_dependencies()

load("@io_tweag_rules_nixpkgs//nixpkgs:nixpkgs.bzl", "nixpkgs_cc_configure", "nixpkgs_flake_package", "nixpkgs_git_repository", "nixpkgs_package", "nixpkgs_python_configure")

nixpkgs_flake_package(
    name = "awscli",
    nix_flake_file = "//tools/aws:flake.nix",
    nix_flake_lock_file = "//tools/aws:flake.lock",
    package = "awscli2",
)

Later, I have a BUILD.bazel file that looks like this:

genrule(
    name = "aws",
    srcs = ["@awscli//:bin/aws"],
    outs = ["awscli/aws"],
    executable = True,
    cmd = "cp $(<) $@",
)

Having trouble figuring out how to bzlmod-ify this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant