From 3e45b61a9920466a8ea06b8ad9350d56ade435bc Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Mon, 6 Aug 2018 01:36:09 +0200 Subject: lib/trivial: add a few examples of usage of assertMsg/assertOneOf --- pkgs/applications/misc/lilyterm/default.nix | 5 ++--- pkgs/applications/science/math/ripser/default.nix | 3 ++- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'pkgs/applications') diff --git a/pkgs/applications/misc/lilyterm/default.nix b/pkgs/applications/misc/lilyterm/default.nix index 72cb1e85802a..948ae7b14a11 100644 --- a/pkgs/applications/misc/lilyterm/default.nix +++ b/pkgs/applications/misc/lilyterm/default.nix @@ -1,13 +1,12 @@ -{ stdenv, fetchurl, fetchFromGitHub +{ stdenv, lib, fetchurl, fetchFromGitHub , pkgconfig , autoconf, automake, intltool, gettext , gtk, vte -# "stable" or "git" , flavour ? "stable" }: -assert flavour == "stable" || flavour == "git"; +assert lib.assertOneOf "flavour" flavour [ "stable" "git" ]; let stuff = diff --git a/pkgs/applications/science/math/ripser/default.nix b/pkgs/applications/science/math/ripser/default.nix index 21948a279d07..5e0b7fc300ba 100644 --- a/pkgs/applications/science/math/ripser/default.nix +++ b/pkgs/applications/science/math/ripser/default.nix @@ -8,7 +8,8 @@ with stdenv.lib; -assert elem fileFormat ["lowerTriangularCsv" "upperTriangularCsv" "dipha"]; +assert assertOneOf "fileFormat" fileFormat + ["lowerTriangularCsv" "upperTriangularCsv" "dipha"]; assert useGoogleHashmap -> sparsehash != null; let -- cgit 1.4.1