diff --git a/pkgs/applications/misc/makehuman/default.nix b/pkgs/applications/misc/makehuman/default.nix
index 51f27c3d7c10..309d0a84771a 100644
--- a/pkgs/applications/misc/makehuman/default.nix
+++ b/pkgs/applications/misc/makehuman/default.nix
@@ -55,9 +55,7 @@ stdenv.mkDerivation rec {
qtbase
];
- propagatedBuildInputs = [
- pydeps
- ];
+ propagatedBuildInputs = pydeps;
finalSource = "${pname}-final";
diff --git a/pkgs/applications/networking/instant-messengers/gajim/default.nix b/pkgs/applications/networking/instant-messengers/gajim/default.nix
index 1a2a01727179..6026917dedbe 100644
--- a/pkgs/applications/networking/instant-messengers/gajim/default.nix
+++ b/pkgs/applications/networking/instant-messengers/gajim/default.nix
@@ -113,10 +113,10 @@ python3.pkgs.buildPythonApplication rec {
sqlalchemy
emoji
httpx
- httpx.optional-dependencies.socks
h2
truststore
]
+ ++ httpx.optional-dependencies.socks
++ lib.optionals enableE2E [
pycrypto
python-gnupg
diff --git a/pkgs/by-name/_1/_1password-cli/package.nix b/pkgs/by-name/_1/_1password-cli/package.nix
index c8f0e8f9552b..2ab9a7ad7180 100644
--- a/pkgs/by-name/_1/_1password-cli/package.nix
+++ b/pkgs/by-name/_1/_1password-cli/package.nix
@@ -51,7 +51,7 @@ stdenv.mkDerivation {
versionCheckHook
]
++ lib.optional stdenv.hostPlatform.isLinux autoPatchelfHook
- ++ lib.optional stdenv.hostPlatform.isDarwin [
+ ++ lib.optionals stdenv.hostPlatform.isDarwin [
xar
cpio
];
diff --git a/pkgs/by-name/aw/aws-sam-cli/package.nix b/pkgs/by-name/aw/aws-sam-cli/package.nix
index e3acde7e1a3d..01a20b3b9ccb 100644
--- a/pkgs/by-name/aw/aws-sam-cli/package.nix
+++ b/pkgs/by-name/aw/aws-sam-cli/package.nix
@@ -67,22 +67,25 @@ python3.pkgs.buildPythonApplication rec {
tzlocal
watchdog
]
- ++ (with python3.pkgs.boto3-stubs.optional-dependencies; [
- apigateway
- cloudformation
- ecr
- iam
- kinesis
- lambda
- s3
- schemas
- secretsmanager
- signer
- sqs
- stepfunctions
- sts
- xray
- ]);
+ ++ (
+ with python3.pkgs.boto3-stubs.optional-dependencies;
+ lib.concatLists [
+ apigateway
+ cloudformation
+ ecr
+ iam
+ kinesis
+ lambda
+ s3
+ schemas
+ secretsmanager
+ signer
+ sqs
+ stepfunctions
+ sts
+ xray
+ ]
+ );
patches = [
# Remove after aws-sam-cli > 1.154.0
diff --git a/pkgs/by-name/ba/basedpyright/package.nix b/pkgs/by-name/ba/basedpyright/package.nix
index 3070840aac38..49fdb388ae4f 100644
--- a/pkgs/by-name/ba/basedpyright/package.nix
+++ b/pkgs/by-name/ba/basedpyright/package.nix
@@ -40,7 +40,7 @@ buildNpmPackage rec {
docify
pkg-config
]
- ++ lib.optional stdenv.hostPlatform.isDarwin [ clang_20 ]; # clang_21 breaks keytar
+ ++ lib.optional stdenv.hostPlatform.isDarwin clang_20; # clang_21 breaks keytar
buildInputs = [ libsecret ];
diff --git a/pkgs/by-name/br/browsr/package.nix b/pkgs/by-name/br/browsr/package.nix
index db45c39c6d68..a3b2fa3ca73e 100644
--- a/pkgs/by-name/br/browsr/package.nix
+++ b/pkgs/by-name/br/browsr/package.nix
@@ -46,7 +46,7 @@ python3Packages.buildPythonApplication (finalAttrs: {
textual
textual-universal-directorytree
]
- ++ lib.attrVals extras finalAttrs.passthru.optional-dependencies;
+ ++ lib.flatten (lib.attrVals extras finalAttrs.passthru.optional-dependencies);
optional-dependencies = with python3Packages; {
all = [
diff --git a/pkgs/by-name/ca/caja-with-extensions/package.nix b/pkgs/by-name/ca/caja-with-extensions/package.nix
index 43034921a6de..d9374778cb86 100644
--- a/pkgs/by-name/ca/caja-with-extensions/package.nix
+++ b/pkgs/by-name/ca/caja-with-extensions/package.nix
@@ -26,7 +26,7 @@ stdenv.mkDerivation {
];
buildInputs =
- lib.forEach selectedExtensions (x: x.buildInputs)
+ lib.concatMap (x: x.buildInputs) selectedExtensions
++ selectedExtensions
++ [ caja ]
++ caja.buildInputs;
diff --git a/pkgs/by-name/cd/cdxgen/package.nix b/pkgs/by-name/cd/cdxgen/package.nix
index 24a15b7a8cb4..2f5f1e410631 100644
--- a/pkgs/by-name/cd/cdxgen/package.nix
+++ b/pkgs/by-name/cd/cdxgen/package.nix
@@ -30,9 +30,7 @@ stdenv.mkDerivation (finalAttrs: {
pnpm_10
python3 # required for sqlite3 bindings
]
- ++ lib.optional stdenv.hostPlatform.isDarwin [
- cctools.libtool
- ];
+ ++ lib.optional stdenv.hostPlatform.isDarwin cctools.libtool;
pnpmDeps = fetchPnpmDeps {
inherit (finalAttrs) pname version src;
diff --git a/pkgs/by-name/et/etesync-dav/package.nix b/pkgs/by-name/et/etesync-dav/package.nix
index 046b650bbce4..8d02f6f709b4 100644
--- a/pkgs/by-name/et/etesync-dav/package.nix
+++ b/pkgs/by-name/et/etesync-dav/package.nix
@@ -27,17 +27,19 @@ python3Packages.buildPythonApplication (finalAttrs: {
pythonRelaxDeps = [ "radicale" ];
- dependencies = with python3Packages; [
- appdirs
- etebase
- etesync
- flask
- flask-wtf
- msgpack
- (python3Packages.toPythonModule (radicale.override { python3 = python; }))
- requests
- requests.optional-dependencies.socks
- ];
+ dependencies =
+ with python3Packages;
+ [
+ appdirs
+ etebase
+ etesync
+ flask
+ flask-wtf
+ msgpack
+ (python3Packages.toPythonModule (radicale.override { python3 = python; }))
+ requests
+ ]
+ ++ requests.optional-dependencies.socks;
doCheck = false;
diff --git a/pkgs/by-name/fa/fastnlo-toolkit/package.nix b/pkgs/by-name/fa/fastnlo-toolkit/package.nix
index d717e9208d54..926e0a89db62 100644
--- a/pkgs/by-name/fa/fastnlo-toolkit/package.nix
+++ b/pkgs/by-name/fa/fastnlo-toolkit/package.nix
@@ -48,13 +48,11 @@ stdenv.mkDerivation (finalAttrs: {
++ lib.optional withPython python
++ lib.optional (withPython && python.isPy3k) ncurses;
- propagatedNativeBuildInputs = lib.optional withPython [ swig ];
+ propagatedNativeBuildInputs = lib.optional withPython swig;
propagatedBuildInputs = [
zlib
]
- ++ lib.optional withPython [
- python.pkgs.distutils
- ];
+ ++ lib.optional withPython python.pkgs.distutils;
preConfigure = ''
substituteInPlace ./fastnlotoolkit/Makefile.in \
diff --git a/pkgs/by-name/gn/gnome-panel/wrapper.nix b/pkgs/by-name/gn/gnome-panel/wrapper.nix
index cb7f6d5d160d..ec517b53f81f 100644
--- a/pkgs/by-name/gn/gnome-panel/wrapper.nix
+++ b/pkgs/by-name/gn/gnome-panel/wrapper.nix
@@ -34,7 +34,7 @@ stdenv.mkDerivation {
];
buildInputs =
- selectedPanelModulePackages ++ lib.forEach selectedPanelModulePackages (x: x.buildInputs or [ ]);
+ selectedPanelModulePackages ++ lib.concatMap (x: x.buildInputs or [ ]) selectedPanelModulePackages;
dontUnpack = true;
dontConfigure = true;
diff --git a/pkgs/by-name/gr/grap/package.nix b/pkgs/by-name/gr/grap/package.nix
index 3115c362ac7f..d131123dad15 100644
--- a/pkgs/by-name/gr/grap/package.nix
+++ b/pkgs/by-name/gr/grap/package.nix
@@ -38,9 +38,9 @@ python3Packages.buildPythonApplication rec {
];
buildInputs = [
- boost183.all
libseccomp
- ];
+ ]
+ ++ boost183.all;
strictDeps = true;
diff --git a/pkgs/by-name/gr/groonga/package.nix b/pkgs/by-name/gr/groonga/package.nix
index c6d882d4feee..2c995d07f11f 100644
--- a/pkgs/by-name/gr/groonga/package.nix
+++ b/pkgs/by-name/gr/groonga/package.nix
@@ -51,7 +51,7 @@ stdenv.mkDerivation (finalAttrs: {
++ lib.optionals lz4Support [
lz4
]
- ++ lib.optional zlibSupport [
+ ++ lib.optionals zlibSupport [
zlib
]
++ lib.optionals suggestSupport [
diff --git a/pkgs/by-name/is/isrcsubmit/package.nix b/pkgs/by-name/is/isrcsubmit/package.nix
index d157d9aafc7c..873d97f391ff 100644
--- a/pkgs/by-name/is/isrcsubmit/package.nix
+++ b/pkgs/by-name/is/isrcsubmit/package.nix
@@ -35,9 +35,7 @@ python3Packages.buildPythonApplication {
musicbrainzngs
discid
]
- ++ lib.optional withKeyring [
- keyring
- ];
+ ++ lib.optional withKeyring keyring;
pythonImportsCheck = [ "isrcsubmit" ];
diff --git a/pkgs/by-name/ji/jinja2-cli/package.nix b/pkgs/by-name/ji/jinja2-cli/package.nix
index a5ed8fcf1b77..04995502c270 100644
--- a/pkgs/by-name/ji/jinja2-cli/package.nix
+++ b/pkgs/by-name/ji/jinja2-cli/package.nix
@@ -37,7 +37,7 @@ python3.pkgs.buildPythonApplication rec {
[
jinja2
]
- ++ lib.attrVals extras optional-dependencies;
+ ++ lib.flatten (lib.attrVals extras optional-dependencies);
pythonImportsCheck = [ "jinja2cli" ];
diff --git a/pkgs/by-name/ki/kitsas/package.nix b/pkgs/by-name/ki/kitsas/package.nix
index bd7436c32c5c..d96b64028c4d 100644
--- a/pkgs/by-name/ki/kitsas/package.nix
+++ b/pkgs/by-name/ki/kitsas/package.nix
@@ -32,9 +32,7 @@ stdenv.mkDerivation (finalAttrs: {
qt6.qtsvg
qt6.qtwebengine
]
- ++ lib.optional stdenv.hostPlatform.isLinux [
- qt6.qtwayland
- ];
+ ++ lib.optional stdenv.hostPlatform.isLinux qt6.qtwayland;
# We use a separate build-dir as otherwise ld seems to get confused between
# directory and executable name on buildPhase.
diff --git a/pkgs/by-name/la/ladybird/package.nix b/pkgs/by-name/la/ladybird/package.nix
index e62fd0f91a55..8c74b38a637f 100644
--- a/pkgs/by-name/la/ladybird/package.nix
+++ b/pkgs/by-name/la/ladybird/package.nix
@@ -131,7 +131,7 @@ stdenv.mkDerivation (finalAttrs: {
icu78
simdjson
]
- ++ lib.optional stdenv.hostPlatform.isLinux [
+ ++ lib.optionals stdenv.hostPlatform.isLinux [
libpulseaudio.dev
qt6Packages.qtwayland
];
diff --git a/pkgs/by-name/li/libass/package.nix b/pkgs/by-name/li/libass/package.nix
index d3dc3d6053dc..f7f499b66af4 100644
--- a/pkgs/by-name/li/libass/package.nix
+++ b/pkgs/by-name/li/libass/package.nix
@@ -45,9 +45,7 @@ stdenv.mkDerivation (finalAttrs: {
harfbuzz
]
++ lib.optional fontconfigSupport fontconfig
- ++ lib.optional stdenv.hostPlatform.isDarwin [
- libiconv
- ];
+ ++ lib.optional stdenv.hostPlatform.isDarwin libiconv;
meta = {
description = "Portable ASS/SSA subtitle renderer";
diff --git a/pkgs/by-name/mc/mcrl2/package.nix b/pkgs/by-name/mc/mcrl2/package.nix
index eda177c67e3d..b849cbe89097 100644
--- a/pkgs/by-name/mc/mcrl2/package.nix
+++ b/pkgs/by-name/mc/mcrl2/package.nix
@@ -56,7 +56,7 @@ stdenv.mkDerivation rec {
qt6.qtbase
boost
]
- ++ lib.optional stdenv.hostPlatform.isDarwin [ makeWrapper ];
+ ++ lib.optional stdenv.hostPlatform.isDarwin makeWrapper;
dontWrapQtApps = true;
diff --git a/pkgs/by-name/mo/modrinth-app-unwrapped/package.nix b/pkgs/by-name/mo/modrinth-app-unwrapped/package.nix
index d48f3b3b436d..99a6e03c8abe 100644
--- a/pkgs/by-name/mo/modrinth-app-unwrapped/package.nix
+++ b/pkgs/by-name/mo/modrinth-app-unwrapped/package.nix
@@ -91,7 +91,7 @@ rustPlatform.buildRustPackage (finalAttrs: {
pnpmConfigHook
pnpm_10
]
- ++ lib.optional stdenv.hostPlatform.isDarwin [
+ ++ lib.optionals stdenv.hostPlatform.isDarwin [
makeBinaryWrapper
xcbuild
];
diff --git a/pkgs/by-name/mu/music-assistant/package.nix b/pkgs/by-name/mu/music-assistant/package.nix
index 23610a242dd2..64b316f8d7c8 100644
--- a/pkgs/by-name/mu/music-assistant/package.nix
+++ b/pkgs/by-name/mu/music-assistant/package.nix
@@ -177,7 +177,7 @@ python.pkgs.buildPythonApplication rec {
pytestCheckHook
]
++ lib.concatAttrValues optional-dependencies
- ++ (map (provider: providerPackages.${provider} python.pkgs) [
+ ++ (lib.concatMap (provider: providerPackages.${provider} python.pkgs) [
"audible"
"dlna"
"jellyfin"
diff --git a/pkgs/by-name/n8/n8n/package.nix b/pkgs/by-name/n8/n8n/package.nix
index 6a57b725baef..84491ae199d9 100644
--- a/pkgs/by-name/n8/n8n/package.nix
+++ b/pkgs/by-name/n8/n8n/package.nix
@@ -50,7 +50,7 @@ stdenv.mkDerivation (finalAttrs: {
makeWrapper
dart-sass
]
- ++ lib.optional stdenv.hostPlatform.isDarwin [
+ ++ lib.optionals stdenv.hostPlatform.isDarwin [
cctools
xcbuild
];
diff --git a/pkgs/by-name/ni/nix-unit/package.nix b/pkgs/by-name/ni/nix-unit/package.nix
index 5d6e811ac2a1..0007f3ff469e 100644
--- a/pkgs/by-name/ni/nix-unit/package.nix
+++ b/pkgs/by-name/ni/nix-unit/package.nix
@@ -48,7 +48,7 @@ stdenv.mkDerivation (finalAttrs: {
# nlohmann_json can be only discovered via cmake files
cmake
]
- ++ lib.optional stdenv.cc.isClang [ clang-tools ];
+ ++ lib.optional stdenv.cc.isClang clang-tools;
postInstall = ''
wrapProgram "$out/bin/nix-unit" --prefix PATH : ${difftastic}/bin
diff --git a/pkgs/by-name/no/novops/package.nix b/pkgs/by-name/no/novops/package.nix
index 582b31f11fbc..670d7a992255 100644
--- a/pkgs/by-name/no/novops/package.nix
+++ b/pkgs/by-name/no/novops/package.nix
@@ -25,7 +25,7 @@ rustPlatform.buildRustPackage (finalAttrs: {
buildInputs = [
openssl # required for openssl-sys
]
- ++ lib.optional stdenv.hostPlatform.isDarwin [
+ ++ lib.optionals stdenv.hostPlatform.isDarwin [
libiconv
];
diff --git a/pkgs/by-name/ol/ollama/package.nix b/pkgs/by-name/ol/ollama/package.nix
index 155c3ee506e9..2093557b0949 100644
--- a/pkgs/by-name/ol/ollama/package.nix
+++ b/pkgs/by-name/ol/ollama/package.nix
@@ -168,10 +168,12 @@ goBuild (finalAttrs: {
cmake
gitMinimal
]
- ++ lib.optionals enableRocm [
- rocmPackages.llvm.bintools
+ ++ lib.optionals enableRocm (
rocmLibs
- ]
+ ++ [
+ rocmPackages.llvm.bintools
+ ]
+ )
++ lib.optionals enableCuda [ cudaPackages.cuda_nvcc ]
++ lib.optionals (enableRocm || enableCuda) [
makeBinaryWrapper
diff --git a/pkgs/by-name/pa/pat/package.nix b/pkgs/by-name/pa/pat/package.nix
index f52534b444fe..465ab4575510 100644
--- a/pkgs/by-name/pa/pat/package.nix
+++ b/pkgs/by-name/pa/pat/package.nix
@@ -27,7 +27,7 @@ buildGoModule (finalAttrs: {
nativeBuildInputs = [ installShellFiles ];
- buildInputs = lib.optional stdenv.hostPlatform.isLinux [ libax25 ];
+ buildInputs = lib.optional stdenv.hostPlatform.isLinux libax25;
# Needed by wl2k-go go module for libax25 to include support for Linux' AX.25 stack by linking against libax25.
# ref: https://github.com/la5nta/wl2k-go/blob/abe3ae5bf6a2eec670a21672d461d1c3e1d4c2f3/transport/ax25/ax25.go#L11-L17
diff --git a/pkgs/by-name/pa/patroni/package.nix b/pkgs/by-name/pa/patroni/package.nix
index 1a71561808c3..c2f035bd9674 100644
--- a/pkgs/by-name/pa/patroni/package.nix
+++ b/pkgs/by-name/pa/patroni/package.nix
@@ -50,7 +50,7 @@ python3Packages.buildPythonApplication (finalAttrs: {
urllib3
ydiff
])
- ++ lib.attrVals extras finalAttrs.passthru.optional-dependencies;
+ ++ lib.flatten (lib.attrVals extras finalAttrs.passthru.optional-dependencies);
optional-dependencies = with python3Packages; {
aws = [ boto3 ];
diff --git a/pkgs/by-name/pe/persepolis/package.nix b/pkgs/by-name/pe/persepolis/package.nix
index d6fa0eaa6736..f07b52fad3dd 100644
--- a/pkgs/by-name/pe/persepolis/package.nix
+++ b/pkgs/by-name/pe/persepolis/package.nix
@@ -40,8 +40,9 @@ python3.pkgs.buildPythonApplication (finalAttrs: {
"\${qtWrapperArgs[@]}"
];
- propagatedBuildInputs = [
- (with python3.pkgs; [
+ propagatedBuildInputs = (
+ with python3.pkgs;
+ [
psutil
pyside6
pysocks
@@ -51,8 +52,8 @@ python3.pkgs.buildPythonApplication (finalAttrs: {
setproctitle
setuptools
yt-dlp
- ])
- ];
+ ]
+ );
meta = {
description = "Download manager GUI written in Python";
diff --git a/pkgs/by-name/pv/pvzge/package.nix b/pkgs/by-name/pv/pvzge/package.nix
index 61bdf577cdcb..df5a2c35353e 100644
--- a/pkgs/by-name/pv/pvzge/package.nix
+++ b/pkgs/by-name/pv/pvzge/package.nix
@@ -34,7 +34,7 @@ stdenvNoCC.mkDerivation (finalAttrs: {
makeWrapper
imagemagick
]
- ++ lib.optional stdenvNoCC.hostPlatform.isDarwin [ desktopToDarwinBundle ];
+ ++ lib.optional stdenvNoCC.hostPlatform.isDarwin desktopToDarwinBundle;
postPatch = ''
sed -i "s|
.*|PvZ2: Gardendless|" docs/index.html
diff --git a/pkgs/by-name/py/pympress/package.nix b/pkgs/by-name/py/pympress/package.nix
index e5482da2bbe0..288ea438fb5d 100644
--- a/pkgs/by-name/py/pympress/package.nix
+++ b/pkgs/by-name/py/pympress/package.nix
@@ -37,9 +37,7 @@ python3Packages.buildPythonApplication (finalAttrs: {
pycairo
pygobject3
]
- ++ lib.optional withVLC [
- python-vlc
- ];
+ ++ lib.optional withVLC python-vlc;
nativeBuildInputs = [
wrapGAppsHook3
diff --git a/pkgs/by-name/re/redo-apenwarr/package.nix b/pkgs/by-name/re/redo-apenwarr/package.nix
index adbb56107b22..38aae496b40d 100644
--- a/pkgs/by-name/re/redo-apenwarr/package.nix
+++ b/pkgs/by-name/re/redo-apenwarr/package.nix
@@ -66,11 +66,9 @@ stdenv.mkDerivation (finalAttrs: {
nativeBuildInputs = [
python3
- (with python3.pkgs; [
- beautifulsoup4
- markdown
- ])
which
+ python3.pkgs.beautifulsoup4
+ python3.pkgs.markdown
installShellFiles
gnumake42 # fails with make 4.4
];
diff --git a/pkgs/by-name/re/renovate/package.nix b/pkgs/by-name/re/renovate/package.nix
index 44b29adaa74e..8c2dd9008831 100644
--- a/pkgs/by-name/re/renovate/package.nix
+++ b/pkgs/by-name/re/renovate/package.nix
@@ -42,7 +42,7 @@ stdenv.mkDerivation (finalAttrs: {
python3
yq-go
]
- ++ lib.optional stdenv.hostPlatform.isDarwin [
+ ++ lib.optionals stdenv.hostPlatform.isDarwin [
xcbuild
cctools # contains libtool, required by better-sqlite3
];
diff --git a/pkgs/by-name/ry/ryubing/package.nix b/pkgs/by-name/ry/ryubing/package.nix
index 11c1b657625d..4551d4c6ffcc 100644
--- a/pkgs/by-name/ry/ryubing/package.nix
+++ b/pkgs/by-name/ry/ryubing/package.nix
@@ -43,10 +43,8 @@ buildDotnetModule rec {
};
nativeBuildInputs =
- lib.optional stdenv.hostPlatform.isLinux [
- wrapGAppsHook3
- ]
- ++ lib.optional stdenv.hostPlatform.isDarwin [
+ lib.optional stdenv.hostPlatform.isLinux wrapGAppsHook3
+ ++ lib.optionals stdenv.hostPlatform.isDarwin [
cctools
darwin.sigtool
];
@@ -82,11 +80,11 @@ buildDotnetModule rec {
libGL
SDL2
]
- ++ lib.optional (!stdenv.hostPlatform.isDarwin) [
+ ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [
udev
pulseaudio
]
- ++ lib.optional stdenv.hostPlatform.isDarwin [ moltenvk ];
+ ++ lib.optional stdenv.hostPlatform.isDarwin moltenvk;
projectFile = "Ryujinx.sln";
testProjectFile = "src/Ryujinx.Tests/Ryujinx.Tests.csproj";
diff --git a/pkgs/by-name/sh/shairport-sync/package.nix b/pkgs/by-name/sh/shairport-sync/package.nix
index d760a0208aec..4fffcd8bbde7 100644
--- a/pkgs/by-name/sh/shairport-sync/package.nix
+++ b/pkgs/by-name/sh/shairport-sync/package.nix
@@ -75,7 +75,7 @@ stdenv.mkDerivation (finalAttrs: {
# mkDerivation's splicing logic from kicking in.
"${glib.dev}"
]
- ++ optional enableAirplay2 [
+ ++ optionals enableAirplay2 [
libplist.bin
unixtools.xxd
];
diff --git a/pkgs/by-name/so/sope/package.nix b/pkgs/by-name/so/sope/package.nix
index 3ef83e1fe6ab..1178a10b7563 100644
--- a/pkgs/by-name/so/sope/package.nix
+++ b/pkgs/by-name/so/sope/package.nix
@@ -23,7 +23,7 @@ clangStdenv.mkDerivation rec {
hash = "sha256-0G28qDXygDe/TJ2znNE+NVQry3bkqUO59jqtJm/t2S4=";
};
- nativeBuildInputs = lib.optional (libpq != null) [ libpq.pg_config ];
+ nativeBuildInputs = lib.optional (libpq != null) libpq.pg_config;
buildInputs = [
gnustep-base
libxml2
diff --git a/pkgs/by-name/st/streamlink/package.nix b/pkgs/by-name/st/streamlink/package.nix
index 6dd2a98702b0..70ca89507d66 100644
--- a/pkgs/by-name/st/streamlink/package.nix
+++ b/pkgs/by-name/st/streamlink/package.nix
@@ -58,7 +58,7 @@ python3Packages.buildPythonApplication rec {
urllib3
websocket-client
]
- ++ lib.attrVals extras optional-dependencies;
+ ++ lib.flatten (lib.attrVals extras optional-dependencies);
optional-dependencies = with python3Packages; {
decompress = urllib3.optional-dependencies.brotli ++ urllib3.optional-dependencies.zstd;
diff --git a/pkgs/by-name/te/terminusdb/package.nix b/pkgs/by-name/te/terminusdb/package.nix
index 535b866c13fb..4884cfc2208d 100644
--- a/pkgs/by-name/te/terminusdb/package.nix
+++ b/pkgs/by-name/te/terminusdb/package.nix
@@ -105,10 +105,8 @@ stdenv.mkDerivation (finalAttrs: {
strictDeps = true;
nativeBuildInputs = [
- (with rustPlatform; [
- cargoSetupHook
- bindgenHook # provides libclang
- ])
+ rustPlatform.cargoSetupHook
+ rustPlatform.bindgenHook # provides libclang
cargo
installShellFiles
protobuf
diff --git a/pkgs/by-name/ti/tigervnc/package.nix b/pkgs/by-name/ti/tigervnc/package.nix
index 4e6a935afb58..cebd3311ac44 100644
--- a/pkgs/by-name/ti/tigervnc/package.nix
+++ b/pkgs/by-name/ti/tigervnc/package.nix
@@ -209,7 +209,7 @@ stdenv.mkDerivation (finalAttrs: {
]
);
- propagatedBuildInputs = lib.optional stdenv.hostPlatform.isLinux xorg-server.propagatedBuildInputs;
+ propagatedBuildInputs = lib.optionals stdenv.hostPlatform.isLinux xorg-server.propagatedBuildInputs;
passthru.tests.tigervnc = nixosTests.tigervnc;
diff --git a/pkgs/by-name/tu/turses/package.nix b/pkgs/by-name/tu/turses/package.nix
index a24ee8d7dcb5..7c04dae2c0c2 100644
--- a/pkgs/by-name/tu/turses/package.nix
+++ b/pkgs/by-name/tu/turses/package.nix
@@ -22,10 +22,12 @@ let
tag = "v${version}";
hash = "sha256-3BbQeCaAhlz9h5GnhficNubJHu4kTpnCDM4oKzlti0w=";
};
- dependencies = oldAttrs.dependencies ++ [
- super.six
- super.requests.optional-dependencies.socks
- ];
+ dependencies =
+ oldAttrs.dependencies
+ ++ [
+ super.six
+ ]
+ ++ super.requests.optional-dependencies.socks;
doCheck = false;
});
};
diff --git a/pkgs/by-name/vc/vcv-rack/package.nix b/pkgs/by-name/vc/vcv-rack/package.nix
index 8e49779c72c1..d7dcbe4c22ca 100644
--- a/pkgs/by-name/vc/vcv-rack/package.nix
+++ b/pkgs/by-name/vc/vcv-rack/package.nix
@@ -123,7 +123,7 @@ let
libjack2
libpulseaudio
]
- ++ lib.optional stdenv.hostPlatform.isDarwin [ apple-sdk_14 ];
+ ++ lib.optional stdenv.hostPlatform.isDarwin apple-sdk_14;
cmakeFlags = [
(lib.cmakeBool "RTAUDIO_API_ALSA" stdenv.hostPlatform.isLinux)
diff --git a/pkgs/by-name/vo/voxtype/package.nix b/pkgs/by-name/vo/voxtype/package.nix
index 62084d779d78..b28df4f4a5ac 100644
--- a/pkgs/by-name/vo/voxtype/package.nix
+++ b/pkgs/by-name/vo/voxtype/package.nix
@@ -82,7 +82,7 @@ rustPlatform.buildRustPackage (finalAttrs: {
makeBinaryWrapper
pkg-config
]
- ++ lib.optional vulkanSupport [
+ ++ lib.optionals vulkanSupport [
shaderc
vulkan-headers
vulkan-loader
diff --git a/pkgs/by-name/wh/whoogle-search/package.nix b/pkgs/by-name/wh/whoogle-search/package.nix
index def30f89e255..260ee63aa50e 100644
--- a/pkgs/by-name/wh/whoogle-search/package.nix
+++ b/pkgs/by-name/wh/whoogle-search/package.nix
@@ -18,44 +18,46 @@ python3Packages.buildPythonApplication (finalAttrs: {
build-system = with python3Packages; [ setuptools ];
- dependencies = with python3Packages; [
- attrs
- beautifulsoup4
- brotli
- cachetools
- certifi
- cffi
- click
- cryptography
- cssutils
- defusedxml
- flask
- h11
- httpcore
- httpx
- httpx.optional-dependencies.http2
- httpx.optional-dependencies.socks
- idna
- itsdangerous
- jinja2
- markupsafe
- more-itertools
- packaging
- pluggy
- pycodestyle
- pycparser
- pyopenssl
- pyparsing
- pytest
- python-dateutil
- python-dotenv
- soupsieve
- stem
- validators
- waitress
- wcwidth
- werkzeug
- ];
+ dependencies =
+ with python3Packages;
+ [
+ attrs
+ beautifulsoup4
+ brotli
+ cachetools
+ certifi
+ cffi
+ click
+ cryptography
+ cssutils
+ defusedxml
+ flask
+ h11
+ httpcore
+ httpx
+ idna
+ itsdangerous
+ jinja2
+ markupsafe
+ more-itertools
+ packaging
+ pluggy
+ pycodestyle
+ pycparser
+ pyopenssl
+ pyparsing
+ pytest
+ python-dateutil
+ python-dotenv
+ soupsieve
+ stem
+ validators
+ waitress
+ wcwidth
+ werkzeug
+ ]
+ ++ httpx.optional-dependencies.http2
+ ++ httpx.optional-dependencies.socks;
postInstall = ''
# This creates renamed versions of the static files for cache busting,
diff --git a/pkgs/by-name/wt/wtfutil/package.nix b/pkgs/by-name/wt/wtfutil/package.nix
index 4246b93b0ea4..4ed70c5d0cd9 100644
--- a/pkgs/by-name/wt/wtfutil/package.nix
+++ b/pkgs/by-name/wt/wtfutil/package.nix
@@ -47,7 +47,7 @@ buildGoModule (finalAttrs: {
doInstallCheck = true;
# Darwin Error: mkdir /var/empty: file exists
- nativeInstallCheckInputs = lib.optional (!stdenv.hostPlatform.isDarwin) [ versionCheckHook ];
+ nativeInstallCheckInputs = lib.optional (!stdenv.hostPlatform.isDarwin) versionCheckHook;
passthru.updateScript = nix-update-script { };
diff --git a/pkgs/by-name/xp/xpra/package.nix b/pkgs/by-name/xp/xpra/package.nix
index 93eec2ec20c0..a4de10b06d8f 100644
--- a/pkgs/by-name/xp/xpra/package.nix
+++ b/pkgs/by-name/xp/xpra/package.nix
@@ -188,7 +188,7 @@ effectiveBuildPythonApplication rec {
xxhash
systemd
]
- ++ lib.optional withNvenc [
+ ++ lib.optionals withNvenc [
nvencHeaders
nvjpegHeaders
];
diff --git a/pkgs/by-name/yc/ycmd/package.nix b/pkgs/by-name/yc/ycmd/package.nix
index cb6413ab6349..7b64a5f319b3 100644
--- a/pkgs/by-name/yc/ycmd/package.nix
+++ b/pkgs/by-name/yc/ycmd/package.nix
@@ -43,10 +43,10 @@ stdenv.mkDerivation {
[
abseil-cpp
boost
- libllvm.all
- libclang.all
legacy-cgi
]
+ ++ libllvm.all
+ ++ libclang.all
++ [
jedi
jedi-language-server
diff --git a/pkgs/desktops/pantheon/apps/switchboard/wrapper.nix b/pkgs/desktops/pantheon/apps/switchboard/wrapper.nix
index 4d3753946bcc..1bcb7cd0d9cb 100644
--- a/pkgs/desktops/pantheon/apps/switchboard/wrapper.nix
+++ b/pkgs/desktops/pantheon/apps/switchboard/wrapper.nix
@@ -40,7 +40,7 @@ stdenv.mkDerivation {
wrapGAppsHook4
];
- buildInputs = lib.forEach selectedPlugs (x: x.buildInputs) ++ selectedPlugs;
+ buildInputs = lib.concatMap (x: x.buildInputs) selectedPlugs ++ selectedPlugs;
dontUnpack = true;
dontConfigure = true;
diff --git a/pkgs/desktops/pantheon/desktop/wingpanel/wrapper.nix b/pkgs/desktops/pantheon/desktop/wingpanel/wrapper.nix
index cb089c3cd0c5..8bdbbffac072 100644
--- a/pkgs/desktops/pantheon/desktop/wingpanel/wrapper.nix
+++ b/pkgs/desktops/pantheon/desktop/wingpanel/wrapper.nix
@@ -37,7 +37,7 @@ stdenv.mkDerivation {
wrapGAppsHook3
];
- buildInputs = lib.forEach selectedIndicators (x: x.buildInputs) ++ selectedIndicators;
+ buildInputs = lib.concatMap (x: x.buildInputs) selectedIndicators ++ selectedIndicators;
dontUnpack = true;
dontConfigure = true;
diff --git a/pkgs/development/compilers/dotnet/wrapper.nix b/pkgs/development/compilers/dotnet/wrapper.nix
index 1e66c4dbd0de..260717a7ed66 100644
--- a/pkgs/development/compilers/dotnet/wrapper.nix
+++ b/pkgs/development/compilers/dotnet/wrapper.nix
@@ -223,7 +223,7 @@ stdenvNoCC.mkDerivation (finalAttrs: {
buildInputs = [
zlib
]
- ++ lib.optional stdenv.hostPlatform.isDarwin [
+ ++ lib.optionals stdenv.hostPlatform.isDarwin [
swiftPackages.swift
darwin.ICU
];
diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix
index aa07149bf988..e8d9286f0706 100644
--- a/pkgs/development/haskell-modules/configuration-common.nix
+++ b/pkgs/development/haskell-modules/configuration-common.nix
@@ -1572,7 +1572,7 @@ with haskellLib;
# https://github.com/mgajda/json-autotype/issues/25
json-autotype = dontCheck super.json-autotype;
- gargoyle-postgresql-nix = addBuildTool [ pkgs.postgresql ] super.gargoyle-postgresql-nix;
+ gargoyle-postgresql-nix = addBuildTool pkgs.postgresql super.gargoyle-postgresql-nix;
# PortMidi needs an environment variable to have ALSA find its plugins:
# https://github.com/NixOS/nixpkgs/issues/6860
diff --git a/pkgs/development/mobile/androidenv/tools.nix b/pkgs/development/mobile/androidenv/tools.nix
index df216fefdb17..efcbe8bdd6a1 100644
--- a/pkgs/development/mobile/androidenv/tools.nix
+++ b/pkgs/development/mobile/androidenv/tools.nix
@@ -17,7 +17,7 @@ deployAndroidPackage {
name = "androidsdk-tools";
inherit package os arch;
nativeBuildInputs = [ makeWrapper ] ++ lib.optionals (os == "linux") [ autoPatchelfHook ];
- buildInputs = lib.optional (os == "linux") (
+ buildInputs = lib.optionals (os == "linux") (
(with pkgs; [
glibc
freetype
diff --git a/pkgs/development/octave-modules/io/default.nix b/pkgs/development/octave-modules/io/default.nix
index a4db56e12a42..ca3b8b642a61 100644
--- a/pkgs/development/octave-modules/io/default.nix
+++ b/pkgs/development/octave-modules/io/default.nix
@@ -16,9 +16,7 @@ buildOctavePackage rec {
sha256 = "sha256-G49gAZ/lzir1YwEAPjBGRjNJ3VMxI+iXnsS0yev8f2s=";
};
- buildInputs = [
- (lib.optional enableJava jdk)
- ];
+ buildInputs = lib.optional enableJava jdk;
propagatedBuildInputs = [
unzip
diff --git a/pkgs/development/python-modules/drf-pydantic/default.nix b/pkgs/development/python-modules/drf-pydantic/default.nix
index 63543d888cf2..63a41b5c1795 100644
--- a/pkgs/development/python-modules/drf-pydantic/default.nix
+++ b/pkgs/development/python-modules/drf-pydantic/default.nix
@@ -35,8 +35,8 @@ buildPythonPackage rec {
nativeCheckInputs = [
pytestCheckHook
pytest-cov-stub
- pydantic.optional-dependencies.email
- ];
+ ]
+ ++ pydantic.optional-dependencies.email;
meta = {
changelog = "https://github.com/georgebv/drf-pydantic/releases/tag/${src.tag}";
diff --git a/pkgs/development/python-modules/e3-core/default.nix b/pkgs/development/python-modules/e3-core/default.nix
index 8d8266310ab9..1e39e5afa04d 100644
--- a/pkgs/development/python-modules/e3-core/default.nix
+++ b/pkgs/development/python-modules/e3-core/default.nix
@@ -47,7 +47,7 @@ buildPythonPackage rec {
stevedore
tqdm
]
- ++ lib.optional stdenv.hostPlatform.isLinux [
+ ++ lib.optionals stdenv.hostPlatform.isLinux [
# See https://github.com/AdaCore/e3-core/blob/v22.6.0/pyproject.toml#L37-L42
# These are required only on Linux. Darwin has its own set of requirements
psutil
diff --git a/pkgs/development/python-modules/eth-keys/default.nix b/pkgs/development/python-modules/eth-keys/default.nix
index 7377ae5f925b..c5787c8703db 100644
--- a/pkgs/development/python-modules/eth-keys/default.nix
+++ b/pkgs/development/python-modules/eth-keys/default.nix
@@ -46,8 +46,8 @@ buildPythonPackage rec {
pydantic
]
++ optional-dependencies.coincurve
- ++ lib.optional (!isPyPy) eth-hash.optional-dependencies.pysha3
- ++ lib.optional isPyPy eth-hash.optional-dependencies.pycryptodome;
+ ++ lib.optionals (!isPyPy) eth-hash.optional-dependencies.pysha3
+ ++ lib.optionals isPyPy eth-hash.optional-dependencies.pycryptodome;
pythonImportsCheck = [ "eth_keys" ];
diff --git a/pkgs/development/python-modules/langchain-aws/default.nix b/pkgs/development/python-modules/langchain-aws/default.nix
index bfd8fd2ecc3b..1487685ad2c4 100644
--- a/pkgs/development/python-modules/langchain-aws/default.nix
+++ b/pkgs/development/python-modules/langchain-aws/default.nix
@@ -62,8 +62,7 @@ buildPythonPackage (finalAttrs: {
];
optional-dependencies = {
- anthropic = [
- anthropic.optional-dependencies.bedrock
+ anthropic = anthropic.optional-dependencies.bedrock ++ [
langchain-anthropic
];
};
diff --git a/pkgs/development/python-modules/mayim/default.nix b/pkgs/development/python-modules/mayim/default.nix
index 028ed296da2d..8fdcee438141 100644
--- a/pkgs/development/python-modules/mayim/default.nix
+++ b/pkgs/development/python-modules/mayim/default.nix
@@ -44,11 +44,14 @@ buildPythonPackage rec {
pytest-asyncio
pytest-cov-stub
]
- ++ (with optional-dependencies; [
- postgres
- mysql
- sqlite
- ]);
+ ++ (
+ with optional-dependencies;
+ lib.concatLists [
+ postgres
+ mysql
+ sqlite
+ ]
+ );
pythonImportsCheck = [ "mayim" ];
diff --git a/pkgs/development/python-modules/shiboken6/default.nix b/pkgs/development/python-modules/shiboken6/default.nix
index e4f85d57adb9..7492add38e8e 100644
--- a/pkgs/development/python-modules/shiboken6/default.nix
+++ b/pkgs/development/python-modules/shiboken6/default.nix
@@ -34,9 +34,7 @@ stdenv'.mkDerivation (finalAttrs: {
buildInputs = [
python.pkgs.qt6.qtbase
]
- ++ lib.optionals stdenv.hostPlatform.isDarwin [
- python.pkgs.qt6.darwinVersionInputs
- ];
+ ++ lib.optionals stdenv.hostPlatform.isDarwin python.pkgs.qt6.darwinVersionInputs;
cmakeFlags = [
"-DBUILD_TESTS=OFF"
diff --git a/pkgs/development/python-modules/swh-core/default.nix b/pkgs/development/python-modules/swh-core/default.nix
index 8f0e90a34136..fd2590ff4cea 100644
--- a/pkgs/development/python-modules/swh-core/default.nix
+++ b/pkgs/development/python-modules/swh-core/default.nix
@@ -101,7 +101,6 @@ buildPythonPackage (finalAttrs: {
msgpack
postgresql
postgresqlTestHook
- psycopg.optional-dependencies.pool
pylzma
pytestCheckHook
pytest-aiohttp
@@ -119,7 +118,8 @@ buildPythonPackage (finalAttrs: {
types-requests
unzip
pkgs.zstd
- ];
+ ]
+ ++ psycopg.optional-dependencies.pool;
disabledTestPaths = lib.optionals (pythonAtLeast "3.14") [
# shutil.RegistryError: .tar.zst is already registered for "zstdtar"
diff --git a/pkgs/development/python-modules/uptime-kuma-api/default.nix b/pkgs/development/python-modules/uptime-kuma-api/default.nix
index 816eb2ebe254..bfe9f77cba58 100644
--- a/pkgs/development/python-modules/uptime-kuma-api/default.nix
+++ b/pkgs/development/python-modules/uptime-kuma-api/default.nix
@@ -20,8 +20,8 @@ buildPythonPackage rec {
propagatedBuildInputs = [
packaging
python-socketio
- python-socketio.optional-dependencies.client
- ];
+ ]
+ ++ python-socketio.optional-dependencies.client;
pythonImportsCheck = [ "uptime_kuma_api" ];
diff --git a/pkgs/development/ruby-modules/with-packages/default.nix b/pkgs/development/ruby-modules/with-packages/default.nix
index 8e63fa12edaa..5f3d87aefb71 100644
--- a/pkgs/development/ruby-modules/with-packages/default.nix
+++ b/pkgs/development/ruby-modules/with-packages/default.nix
@@ -77,9 +77,9 @@ let
name = "${ruby.name}-with-packages";
nativeBuildInputs = [ makeBinaryWrapper ];
buildInputs = [
- selected
ruby
- ];
+ ]
+ ++ selected;
dontUnpack = true;
diff --git a/pkgs/development/tools/godot/common.nix b/pkgs/development/tools/godot/common.nix
index 1cfcd31d5996..f2d068f68adc 100644
--- a/pkgs/development/tools/godot/common.nix
+++ b/pkgs/development/tools/godot/common.nix
@@ -620,7 +620,7 @@ let
scons
]
++ lib.optionals withWayland [ wayland-scanner ]
- ++ lib.optional (editor && withMono) [
+ ++ lib.optionals (editor && withMono) [
makeWrapper
dotnet-sdk
]
diff --git a/pkgs/os-specific/linux/drbd/driver.nix b/pkgs/os-specific/linux/drbd/driver.nix
index 04dfa1b51a10..612dfc0c4fa2 100644
--- a/pkgs/os-specific/linux/drbd/driver.nix
+++ b/pkgs/os-specific/linux/drbd/driver.nix
@@ -21,8 +21,7 @@ stdenv.mkDerivation (finalAttrs: {
hardeningDisable = [ "pic" ];
- nativeBuildInputs = [
- kernel.moduleBuildDependencies
+ nativeBuildInputs = kernel.moduleBuildDependencies ++ [
flex
coccinelle
python3
diff --git a/pkgs/servers/home-assistant/tests.nix b/pkgs/servers/home-assistant/tests.nix
index 2990ea4a76cf..f2b2b0ca967f 100644
--- a/pkgs/servers/home-assistant/tests.nix
+++ b/pkgs/servers/home-assistant/tests.nix
@@ -6,10 +6,11 @@
let
getComponentDeps = component: home-assistant.getPackages component home-assistant.python.pkgs;
+ inherit (lib) concatMap;
# some components' tests have additional dependencies
extraCheckInputs = with home-assistant.python.pkgs; {
- alexa = map getComponentDeps [
+ alexa = concatMap getComponentDeps [
"cloud"
"frontend"
"stream"
@@ -50,7 +51,7 @@ let
pychromecast
];
lutron_caseta = getComponentDeps "frontend";
- mastodon = map getComponentDeps [
+ mastodon = concatMap getComponentDeps [
"stream"
];
miele = getComponentDeps "cloud";
diff --git a/pkgs/tools/package-management/lix/common-nix-eval-jobs.nix b/pkgs/tools/package-management/lix/common-nix-eval-jobs.nix
index 48b76ca7179b..b43526bcc264 100644
--- a/pkgs/tools/package-management/lix/common-nix-eval-jobs.nix
+++ b/pkgs/tools/package-management/lix/common-nix-eval-jobs.nix
@@ -40,7 +40,7 @@ stdenv.mkDerivation {
# nlohmann_json can be only discovered via cmake files
cmake
]
- ++ (lib.optional stdenv.cc.isClang [ buildPackages.clang-tools ]);
+ ++ (lib.optional stdenv.cc.isClang buildPackages.clang-tools);
# point 'nix edit' and ofborg at the file that defines the attribute,
# not this common file.