diff options
author | Alyssa Ross <hi@alyssa.is> | 2021-04-27 13:52:15 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2021-04-28 21:44:21 +0000 |
commit | a8afbb45c12be27b9b93a802e9e276595899ed5a (patch) | |
tree | b4065c9ea79cf310b1b76976f21067761c206d88 /pkgs | |
parent | 81e1e68eaf6c765147da964d356f704030734dd2 (diff) |
treewide: use lib.warnIf where appropriate
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/applications/networking/browsers/chromium/common.nix | 6 | ||||
-rw-r--r-- | pkgs/development/perl-modules/generic/default.nix | 6 | ||||
-rw-r--r-- | pkgs/servers/jellyfin/default.nix | 5 |
3 files changed, 6 insertions, 11 deletions
diff --git a/pkgs/applications/networking/browsers/chromium/common.nix b/pkgs/applications/networking/browsers/chromium/common.nix index b08ff1ac7c148..73ce022915c7d 100644 --- a/pkgs/applications/networking/browsers/chromium/common.nix +++ b/pkgs/applications/networking/browsers/chromium/common.nix @@ -112,10 +112,8 @@ let warnObsoleteVersionConditional = min-version: result: let ungoogled-version = (importJSON ./upstream-info.json).ungoogled-chromium.version; - in if versionAtLeast ungoogled-version min-version - then warn "chromium: ungoogled version ${ungoogled-version} is newer than a conditional bounded at ${min-version}. You can safely delete it." - result - else result; + in warnIf (versionAtLeast ungoogled-version min-version) "chromium: ungoogled version ${ungoogled-version} is newer than a conditional bounded at ${min-version}. You can safely delete it." + result; chromiumVersionAtLeast = min-version: let result = versionAtLeast upstream-info.version min-version; in warnObsoleteVersionConditional min-version result; diff --git a/pkgs/development/perl-modules/generic/default.nix b/pkgs/development/perl-modules/generic/default.nix index c7b57eae9067d..9beacd65a646e 100644 --- a/pkgs/development/perl-modules/generic/default.nix +++ b/pkgs/development/perl-modules/generic/default.nix @@ -5,10 +5,8 @@ assert attrs?pname -> attrs?version; assert attrs?pname -> !(attrs?name); -(if attrs ? name then - lib.trivial.warn "builtPerlPackage: `name' (\"${attrs.name}\") is deprecated, use `pname' and `version' instead" - else - (x: x)) +lib.warnIf (attrs ? name) "builtPerlPackage: `name' (\"${attrs.name}\") is deprecated, use `pname' and `version' instead" + toPerlModule(stdenv.mkDerivation ( ( lib.recursiveUpdate diff --git a/pkgs/servers/jellyfin/default.nix b/pkgs/servers/jellyfin/default.nix index 2b00cb50073b9..77406c4641501 100644 --- a/pkgs/servers/jellyfin/default.nix +++ b/pkgs/servers/jellyfin/default.nix @@ -11,9 +11,8 @@ let else if isAarch64 then "arm64" else lib.warn "Unsupported architecture, some image processing features might be unavailable" "unknown"; musl = lib.optionalString stdenv.hostPlatform.isMusl - (if (arch != "x64") - then lib.warn "Some image processing features might be unavailable for non x86-64 with Musl" "musl-" - else "musl-"); + (lib.warnIf (arch != "x64") "Some image processing features might be unavailable for non x86-64 with Musl" + "musl-"); runtimeDir = "${os}-${musl}${arch}"; in stdenv.mkDerivation rec { |