From 0680553216b99dd168f54d2832c1872a490d192d Mon Sep 17 00:00:00 2001 From: Mathieu Boespflug Date: Sun, 12 Apr 2020 14:45:56 +0200 Subject: [PATCH] Add quiet attribute `nixpkgs_package` can now optionally be quiet, like it is in v0.6. This is useful for users of Bazel older than v3.0 who pipe the output of `bazel query` to scripts and don't want workspace rules to pollute the output of the query. Closes #85 --- nixpkgs/nixpkgs.bzl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nixpkgs/nixpkgs.bzl b/nixpkgs/nixpkgs.bzl index b1287349e..1280df5fd 100644 --- a/nixpkgs/nixpkgs.bzl +++ b/nixpkgs/nixpkgs.bzl @@ -162,7 +162,7 @@ def _nixpkgs_package_impl(repository_ctx): failure_message = "Cannot build Nix attribute '{}'.".format( repository_ctx.attr.attribute_path, ), - quiet = False, + quiet = repository_ctx.attr.quiet, timeout = timeout, ) output_path = exec_result.stdout.splitlines()[-1] @@ -202,6 +202,7 @@ _nixpkgs_package = repository_rule( "build_file": attr.label(), "build_file_content": attr.string(), "nixopts": attr.string_list(), + "quiet": attr.bool(), "fail_not_supported": attr.bool(default = True, doc = """ If set to True (default) this rule will fail on platforms which do not support Nix (e.g. Windows). If set to False calling this rule will succeed but no output will be generated. """),