bazel: add rules_nixpkgs

Co-authored-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>
This commit is contained in:
Malte Poll 2023-09-06 13:42:55 +02:00 committed by Malte Poll
parent b25ae9a3be
commit 347659e2b0
2 changed files with 33 additions and 0 deletions

View File

@ -1,5 +1,23 @@
workspace(name = "constellation")
# nixpkgs deps
load("//bazel/toolchains:nixpkgs_deps.bzl", "nixpkgs_deps")
nixpkgs_deps()
load("@io_tweag_rules_nixpkgs//nixpkgs:repositories.bzl", "rules_nixpkgs_dependencies")
rules_nixpkgs_dependencies()
load("@io_tweag_rules_nixpkgs//nixpkgs:nixpkgs.bzl", "nixpkgs_flake_package")
nixpkgs_flake_package(
name = "mkosi",
nix_flake_file = "//:flake.nix",
nix_flake_lock_file = "//:flake.lock",
package = "mkosi",
)
# Python toolchain
load("//bazel/toolchains:python_deps.bzl", "python_deps")

View File

@ -0,0 +1,15 @@
"""Bazel rules for building OCI images"""
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
def nixpkgs_deps():
http_archive(
name = "io_tweag_rules_nixpkgs",
sha256 = "1eb0ef4f8388a9b53f99587a6282250852a03eab3160313e584ada7005a7ab53",
strip_prefix = "rules_nixpkgs-ee5c44a5bc470d13699960f493d42ed4c4d806af",
urls = [
"https://cdn.confidential.cloud/constellation/cas/sha256/1eb0ef4f8388a9b53f99587a6282250852a03eab3160313e584ada7005a7ab53",
"https://github.com/tweag/rules_nixpkgs/archive/ee5c44a5bc470d13699960f493d42ed4c4d806af.tar.gz",
],
type = "tar.gz",
)