diff options
Diffstat (limited to 'pkgs/applications')
7 files changed, 17 insertions, 25 deletions
diff --git a/pkgs/applications/editors/vscode/extensions/vscodeEnv.nix b/pkgs/applications/editors/vscode/extensions/vscodeEnv.nix index 7c58a4bdfb342..818cca51772a8 100644 --- a/pkgs/applications/editors/vscode/extensions/vscodeEnv.nix +++ b/pkgs/applications/editors/vscode/extensions/vscodeEnv.nix @@ -25,8 +25,7 @@ }: let mutableExtensionsFilePath = toString mutableExtensionsFile; - mutableExtensions = if builtins.pathExists mutableExtensionsFile - then import mutableExtensionsFilePath else []; + mutableExtensions = lib.optionals builtins.pathExists mutableExtensionsFile (import mutableExtensionsFilePath); vscodeWithConfiguration = import ./vscodeWithConfiguration.nix { inherit lib writeShellScriptBin extensionsFromVscodeMarketplace; vscodeDefault = vscode; diff --git a/pkgs/applications/file-managers/spacefm/default.nix b/pkgs/applications/file-managers/spacefm/default.nix index 334228f98ead1..605340cbc85c0 100644 --- a/pkgs/applications/file-managers/spacefm/default.nix +++ b/pkgs/applications/file-managers/spacefm/default.nix @@ -49,7 +49,7 @@ stdenv.mkDerivation rec { buildInputs = [ gtk3 udev desktop-file-utils shared-mime-info wrapGAppsHook ffmpegthumbnailer jmtpfs lsof udisks2 - ] ++ (if ifuseSupport then [ ifuse ] else []); + ] ++ (lib.optionals ifuseSupport [ ifuse ]); # Introduced because ifuse doesn't build due to CVEs in libplist # Revert when libplist builds again… diff --git a/pkgs/applications/kde/kdevelop/wrapper.nix b/pkgs/applications/kde/kdevelop/wrapper.nix index 86d3de9eb39a9..c73f2bba7b508 100644 --- a/pkgs/applications/kde/kdevelop/wrapper.nix +++ b/pkgs/applications/kde/kdevelop/wrapper.nix @@ -1,7 +1,7 @@ -{ symlinkJoin, kdevelop-unwrapped, plugins ? null }: +{ lib, symlinkJoin, kdevelop-unwrapped, plugins ? null }: symlinkJoin { name = "kdevelop-with-plugins"; - paths = [ kdevelop-unwrapped ] ++ (if plugins != null then plugins else []); + paths = [ kdevelop-unwrapped ] ++ (lib.optionals (plugins != null) plugins); } diff --git a/pkgs/applications/networking/browsers/chromium/browser.nix b/pkgs/applications/networking/browsers/chromium/browser.nix index 2f39e82f3b240..1eea3e8962f80 100644 --- a/pkgs/applications/networking/browsers/chromium/browser.nix +++ b/pkgs/applications/networking/browsers/chromium/browser.nix @@ -90,9 +90,7 @@ mkChromiumDerivation (base: rec { license = if enableWideVine then lib.licenses.unfree else lib.licenses.bsd3; platforms = lib.platforms.linux; mainProgram = "chromium"; - hydraPlatforms = if (channel == "stable" || channel == "ungoogled-chromium") - then ["aarch64-linux" "x86_64-linux"] - else []; + hydraPlatforms = lib.optionals (channel == "stable" || channel == "ungoogled-chromium") ["aarch64-linux" "x86_64-linux"]; timeout = 172800; # 48 hours (increased from the Hydra default of 10h) }; }) diff --git a/pkgs/applications/networking/browsers/firefox/wrapper.nix b/pkgs/applications/networking/browsers/firefox/wrapper.nix index 06bd49facb813..de68807d8f252 100644 --- a/pkgs/applications/networking/browsers/firefox/wrapper.nix +++ b/pkgs/applications/networking/browsers/firefox/wrapper.nix @@ -98,7 +98,7 @@ let usesNixExtensions = nixExtensions != null; - nameArray = builtins.map(a: a.name) (if usesNixExtensions then nixExtensions else []); + nameArray = builtins.map(a: a.name) (lib.optionals usesNixExtensions nixExtensions); requiresSigning = browser ? MOZ_REQUIRE_SIGNING -> toString browser.MOZ_REQUIRE_SIGNING != ""; @@ -114,7 +114,7 @@ let throw "nixExtensions has an invalid entry. Missing extid attribute. Please use fetchfirefoxaddon" else a - ) (if usesNixExtensions then nixExtensions else []); + ) (lib.optionals usesNixExtensions nixExtensions); enterprisePolicies = { diff --git a/pkgs/applications/radio/gnuradio/shared.nix b/pkgs/applications/radio/gnuradio/shared.nix index ff6aaf35bea09..bdbc22cb787d3 100644 --- a/pkgs/applications/radio/gnuradio/shared.nix +++ b/pkgs/applications/radio/gnuradio/shared.nix @@ -37,20 +37,18 @@ rec { ); nativeBuildInputs = lib.flatten (lib.mapAttrsToList ( feat: info: ( - if hasFeature feat then - (if builtins.hasAttr "native" info then info.native else []) ++ - (if builtins.hasAttr "pythonNative" info then info.pythonNative else []) - else - [] + lib.optionals (hasFeature feat) ( + (lib.optionals (builtins.hasAttr "native" info) info.native) ++ + (lib.optionals (builtins.hasAttr "pythonNative" info) info.pythonNative) + ) ) ) featuresInfo); buildInputs = lib.flatten (lib.mapAttrsToList ( feat: info: ( - if hasFeature feat then - (if builtins.hasAttr "runtime" info then info.runtime else []) ++ - (if builtins.hasAttr "pythonRuntime" info then info.pythonRuntime else []) - else - [] + lib.optionals (hasFeature feat) ( + (lib.optionals (builtins.hasAttr "runtime" info) info.runtime) ++ + (lib.optionals (builtins.hasAttr "pythonRuntime" info) info.pythonRuntime) + ) ) ) featuresInfo); cmakeFlags = lib.mapAttrsToList ( diff --git a/pkgs/applications/radio/gnuradio/wrapper.nix b/pkgs/applications/radio/gnuradio/wrapper.nix index 926022353e41f..c38c89fc459b1 100644 --- a/pkgs/applications/radio/gnuradio/wrapper.nix +++ b/pkgs/applications/radio/gnuradio/wrapper.nix @@ -41,12 +41,9 @@ let ++ (builtins.map unwrapped.python.pkgs.toPythonModule extraPackages) ++ lib.flatten (lib.mapAttrsToList ( feat: info: ( - if unwrapped.hasFeature feat then - (if builtins.hasAttr "pythonRuntime" info then info.pythonRuntime else []) - else - [] + lib.optionals ((unwrapped.hasFeature feat) && (builtins.hasAttr "pythonRuntime" info)) info.pythonRuntime ) - ) unwrapped.featuresInfo) + ) unwrapped.featuresInfo) ; pythonEnv = unwrapped.python.withPackages(ps: pythonPkgs); |