about summary refs log tree commit diff
path: root/pkgs/top-level/release-lib.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/top-level/release-lib.nix')
-rw-r--r--pkgs/top-level/release-lib.nix18
1 files changed, 12 insertions, 6 deletions
diff --git a/pkgs/top-level/release-lib.nix b/pkgs/top-level/release-lib.nix
index a6e574a7d11a..ddc449ae59c1 100644
--- a/pkgs/top-level/release-lib.nix
+++ b/pkgs/top-level/release-lib.nix
@@ -1,19 +1,20 @@
 { supportedSystems
 , packageSet ? (import ../..)
 , scrubJobs ? true
+, # Attributes passed to nixpkgs. Don't build packages marked as unfree.
+  nixpkgsArgs ? { config = { allowUnfree = false; inHydra = true; }; }
 }:
 
-with import ../../lib;
+let
+  lib = import ../../lib;
+in with lib;
 
 rec {
 
-  # Ensure that we don't build packages marked as unfree.
-  allPackages = args: packageSet (args // {
-    config.allowUnfree = false;
-    config.inHydra = true;
-  });
+  allPackages = args: packageSet (args // nixpkgsArgs);
 
   pkgs = pkgsFor "x86_64-linux";
+  inherit lib;
 
 
   hydraJob' = if scrubJobs then hydraJob else id;
@@ -43,6 +44,11 @@ rec {
   pkgs_x86_64_cygwin = allPackages { system = "x86_64-cygwin"; };
 
 
+  assertTrue = bool:
+    if bool
+    then pkgs.runCommand "evaluated-to-true" {} "touch $out"
+    else pkgs.runCommand "evaluated-to-false" {} "false";
+
   /* The working or failing mails for cross builds will be sent only to
      the following maintainers, as most package maintainers will not be
      interested in the result of cross building a package. */