From 441708dd85797b17e37a22d39673eb125cfcde63 Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Fri, 9 Aug 2024 04:16:54 +0200 Subject: [PATCH] treewide: simplify boolean logic --- pkgs/applications/file-managers/nnn/default.nix | 6 +++--- pkgs/data/themes/whitesur/default.nix | 6 +++--- pkgs/development/libraries/lightgbm/default.nix | 6 +++--- pkgs/development/libraries/xgboost/default.nix | 2 +- pkgs/development/python-modules/lightgbm/default.nix | 4 ++-- pkgs/tools/misc/tremor-rs/default.nix | 2 +- pkgs/tools/security/gnupg/22.nix | 2 +- pkgs/tools/security/gnupg/24.nix | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/pkgs/applications/file-managers/nnn/default.nix b/pkgs/applications/file-managers/nnn/default.nix index d8c10d783023..fe1cf6778027 100644 --- a/pkgs/applications/file-managers/nnn/default.nix +++ b/pkgs/applications/file-managers/nnn/default.nix @@ -20,9 +20,9 @@ }: # Mutually exclusive options -assert withIcons -> (withNerdIcons == false && withEmojis == false); -assert withNerdIcons -> (withIcons == false && withEmojis == false); -assert withEmojis -> (withIcons == false && withNerdIcons == false); +assert withIcons -> (!withNerdIcons && !withEmojis); +assert withNerdIcons -> (!withIcons && !withEmojis); +assert withEmojis -> (!withIcons && !withNerdIcons); stdenv.mkDerivation (finalAttrs: { pname = "nnn"; diff --git a/pkgs/data/themes/whitesur/default.nix b/pkgs/data/themes/whitesur/default.nix index 969641b487dc..6909db147de3 100644 --- a/pkgs/data/themes/whitesur/default.nix +++ b/pkgs/data/themes/whitesur/default.nix @@ -91,9 +91,9 @@ stdenv.mkDerivation rec { ${lib.optionalString (nautilusSize != null) ("--size " + nautilusSize)} \ ${lib.optionalString (panelOpacity != null) ("--panel-opacity " + panelOpacity)} \ ${lib.optionalString (panelSize != null) ("--panel-size " + panelSize)} \ - ${lib.optionalString (roundedMaxWindow == true) "--roundedmaxwindow"} \ - ${lib.optionalString (nordColor == true) "--nordcolor"} \ - ${lib.optionalString (darkerColor == true) "--darkercolor"} \ + ${lib.optionalString roundedMaxWindow "--roundedmaxwindow"} \ + ${lib.optionalString nordColor "--nordcolor"} \ + ${lib.optionalString darkerColor "--darkercolor"} \ --dest $out/share/themes jdupes --quiet --link-soft --recurse $out/share diff --git a/pkgs/development/libraries/lightgbm/default.nix b/pkgs/development/libraries/lightgbm/default.nix index abb52eb5f0aa..86c85e66ace2 100644 --- a/pkgs/development/libraries/lightgbm/default.nix +++ b/pkgs/development/libraries/lightgbm/default.nix @@ -4,9 +4,9 @@ , rLibrary ? false, cudaPackages, opencl-headers, ocl-icd, boost , llvmPackages, openmpi, openjdk, swig, hadoop, R, rPackages, pandoc }: -assert doCheck -> mpiSupport != true; -assert openclSupport -> cudaSupport != true; -assert cudaSupport -> openclSupport != true; +assert doCheck -> !mpiSupport; +assert openclSupport -> !cudaSupport; +assert cudaSupport -> !openclSupport; stdenv.mkDerivation rec { pnameBase = "lightgbm"; diff --git a/pkgs/development/libraries/xgboost/default.nix b/pkgs/development/libraries/xgboost/default.nix index e5432430cac3..2b96bede313d 100644 --- a/pkgs/development/libraries/xgboost/default.nix +++ b/pkgs/development/libraries/xgboost/default.nix @@ -22,7 +22,7 @@ assert ncclSupport -> (cudaSupport && !cudaPackages.nccl.meta.unsupported); # 2) the R package creates a different binary shared # object that isn't compatible with the regular CLI # tests. -assert rLibrary -> doCheck != true; +assert rLibrary -> !doCheck; let # This ensures xgboost gets the correct libstdc++ when diff --git a/pkgs/development/python-modules/lightgbm/default.nix b/pkgs/development/python-modules/lightgbm/default.nix index 1b5cd1741572..6e07d603b1b4 100644 --- a/pkgs/development/python-modules/lightgbm/default.nix +++ b/pkgs/development/python-modules/lightgbm/default.nix @@ -34,8 +34,8 @@ cudaPackages, }: -assert gpuSupport -> cudaSupport != true; -assert cudaSupport -> gpuSupport != true; +assert gpuSupport -> !cudaSupport; +assert cudaSupport -> !gpuSupport; buildPythonPackage rec { pname = "lightgbm"; diff --git a/pkgs/tools/misc/tremor-rs/default.nix b/pkgs/tools/misc/tremor-rs/default.nix index 65ba3a837474..f346db518047 100644 --- a/pkgs/tools/misc/tremor-rs/default.nix +++ b/pkgs/tools/misc/tremor-rs/default.nix @@ -69,7 +69,7 @@ rustPlatform.buildRustPackage rec { }; # tests failed on x86_64-darwin with SIGILL: illegal instruction - doCheck = !(stdenv.system == "x86_64-darwin"); + doCheck = stdenv.system != "x86_64-darwin"; checkFlags = [ # all try to make a network access diff --git a/pkgs/tools/security/gnupg/22.nix b/pkgs/tools/security/gnupg/22.nix index 38919532a556..5181f78e8a2e 100644 --- a/pkgs/tools/security/gnupg/22.nix +++ b/pkgs/tools/security/gnupg/22.nix @@ -8,7 +8,7 @@ , nixosTests }: -assert guiSupport -> enableMinimal == false; +assert guiSupport -> !enableMinimal; stdenv.mkDerivation rec { pname = "gnupg"; diff --git a/pkgs/tools/security/gnupg/24.nix b/pkgs/tools/security/gnupg/24.nix index b0ffe24a018f..ef1b2e1db518 100644 --- a/pkgs/tools/security/gnupg/24.nix +++ b/pkgs/tools/security/gnupg/24.nix @@ -9,7 +9,7 @@ , nixosTests }: -assert guiSupport -> enableMinimal == false; +assert guiSupport -> !enableMinimal; stdenv.mkDerivation rec { pname = "gnupg";