summary refs log tree commit diff
path: root/pkgs/lib/properties.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/lib/properties.nix')
-rw-r--r--pkgs/lib/properties.nix5
1 files changed, 5 insertions, 0 deletions
diff --git a/pkgs/lib/properties.nix b/pkgs/lib/properties.nix
index 46854d0e1431..d7df14f716f5 100644
--- a/pkgs/lib/properties.nix
+++ b/pkgs/lib/properties.nix
@@ -223,6 +223,11 @@ rec {
       content = mkNotdef;
     };
 
+  mkAssert = assertion: message: content:
+    mkIf
+      (if assertion then true else throw "\nFailed assertion: ${message}")
+      content;
+
   # Remove all "If" statement defined on a value.
   rmIf = foldProperty (
       foldFilter isIf