bazel: always use nix

This commit is contained in:
Malte Poll 2023-10-04 10:51:17 +02:00 committed by Malte Poll
parent d046ba01ff
commit d22f53d7cc
13 changed files with 49 additions and 195 deletions

View file

@ -1,9 +1,8 @@
## Setup
Ensure you have Nix installed. This is recommended in general but a requirement for the following steps.
Ensure you have Nix installed. This is a requirement for the following steps.
Consult the [developer docs](/dev-docs/workflows/build-develop-deploy.md) for more info.
At the very least, `nix` should be in your PATH and either `common --config=nix`
has to be set in the `.bazelrc` or you need to append `--config=nix` to each Bazel command.
At the very least, `nix` should be in your PATH.
## Build

View file

@ -16,19 +16,13 @@ go_library(
go_binary(
name = "cmd",
# keep
data = select({
"@rules_nixpkgs_core//constraints:support_nix": [
"@systemd//:bin/systemd-dissect",
],
"//conditions:default": [],
}),
data = [
"@systemd//:bin/systemd-dissect",
],
embed = [":cmd_lib"],
# keep
env = select({
"@rules_nixpkgs_core//constraints:support_nix": {
"DISSECT_TOOLCHAIN": "$(rootpath @systemd//:bin/systemd-dissect)",
},
"//conditions:default": {},
}),
env = {
"DISSECT_TOOLCHAIN": "$(rootpath @systemd//:bin/systemd-dissect)",
},
visibility = ["//visibility:public"],
)