Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/generators.nix
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ rec {

attr = let attrFilter = name: value: name != "_module" && value != null;
in ind: x: libStr.concatStringsSep "\n" (lib.flatten (lib.mapAttrsToList
(name: value: lib.optional (attrFilter name value) [
(name: value: lib.optionals (attrFilter name value) [
(key "\t${ind}" name)
(expr "\t${ind}" value)
]) x));
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/hardware/video/nvidia.nix
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ in
in optional primeEnabled {
name = igpuDriver;
display = offloadCfg.enable;
modules = optional (igpuDriver == "amdgpu") [ pkgs.xorg.xf86videoamdgpu ];
modules = optionals (igpuDriver == "amdgpu") [ pkgs.xorg.xf86videoamdgpu ];
deviceSection = ''
BusID "${igpuBusId}"
${optionalString (syncCfg.enable && igpuDriver != "amdgpu") ''Option "AccelMethod" "none"''}
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/services/misc/ethminer.nix
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ in
config = mkIf cfg.enable {

systemd.services.ethminer = {
path = optional (cfg.toolkit == "cuda") [ pkgs.cudaPackages.cudatoolkit ];
path = optionals (cfg.toolkit == "cuda") [ pkgs.cudaPackages.cudatoolkit ];
description = "ethminer ethereum mining service";
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/services/misc/podgrab.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ in
};
serviceConfig = {
DynamicUser = true;
EnvironmentFile = lib.optional (cfg.passwordFile != null) [
EnvironmentFile = lib.optionals (cfg.passwordFile != null) [
cfg.passwordFile
];
ExecStart = "${pkgs.podgrab}/bin/podgrab";
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/services/networking/hostapd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ in

environment.systemPackages = [ pkgs.hostapd ];

services.udev.packages = optional (cfg.countryCode != null) [ pkgs.crda ];
services.udev.packages = optionals (cfg.countryCode != null) [ pkgs.crda ];

systemd.services.hostapd =
{ description = "hostapd wireless AP";
Expand Down
4 changes: 2 additions & 2 deletions nixos/modules/services/networking/ntp/chrony.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ let
${cfg.extraConfig}
'';

chronyFlags = "-n -m -u chrony -f ${configFile} ${toString cfg.extraFlags}";
chronyFlags = [ "-n" "-m" "-u" "chrony" "-f" "${configFile}" ] ++ cfg.extraFlags;
in
{
options = {
Expand Down Expand Up @@ -166,7 +166,7 @@ in
unitConfig.ConditionCapability = "CAP_SYS_TIME";
serviceConfig =
{ Type = "simple";
ExecStart = "${chronyPkg}/bin/chronyd ${chronyFlags}";
ExecStart = "${chronyPkg}/bin/chronyd ${builtins.toString chronyFlags}";

ProtectHome = "yes";
ProtectSystem = "full";
Expand Down
4 changes: 2 additions & 2 deletions nixos/modules/services/networking/ntp/ntpd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ let
${cfg.extraConfig}
'';

ntpFlags = "-c ${configFile} -u ntp:ntp ${toString cfg.extraFlags}";
ntpFlags = [ "-c" "${configFile}" "-u" "ntp:ntp" ] ++ cfg.extraFlags;

in

Expand Down Expand Up @@ -137,7 +137,7 @@ in
'';

serviceConfig = {
ExecStart = "@${ntp}/bin/ntpd ntpd -g ${ntpFlags}";
ExecStart = "@${ntp}/bin/ntpd ntpd -g ${builtins.toString ntpFlags}";
Type = "forking";
};
};
Expand Down
4 changes: 2 additions & 2 deletions nixos/modules/services/security/tor.nix
Original file line number Diff line number Diff line change
Expand Up @@ -816,13 +816,13 @@ in
always create a container/VM with a separate Tor daemon instance.
'' ++
flatten (mapAttrsToList (n: o:
optional (o.settings.HiddenServiceVersion == 2) [
optionals (o.settings.HiddenServiceVersion == 2) [
(optional (o.settings.HiddenServiceExportCircuitID != null) ''
HiddenServiceExportCircuitID is used in the HiddenService: ${n}
but this option is only for v3 hidden services.
'')
] ++
optional (o.settings.HiddenServiceVersion != 2) [
optionals (o.settings.HiddenServiceVersion != 2) [
(optional (o.settings.HiddenServiceAuthorizeClient != null) ''
HiddenServiceAuthorizeClient is used in the HiddenService: ${n}
but this option is only for v2 hidden services.
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/services/web-apps/netbox.nix
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ let
'';
})).override {
plugins = ps: ((cfg.plugins ps)
++ optional cfg.enableLdap [ ps.django-auth-ldap ]);
++ optionals cfg.enableLdap [ ps.django-auth-ldap ]);
};
netboxManageScript = with pkgs; (writeScriptBin "netbox-manage" ''
#!${stdenv.shell}
Expand Down
4 changes: 2 additions & 2 deletions nixos/tests/installed-tests/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ let
, withX11 ? false

# Extra flags to pass to gnome-desktop-testing-runner.
, testRunnerFlags ? ""
, testRunnerFlags ? []

# Extra attributes to pass to makeTest.
# They will be recursively merged into the attrset created by this function.
Expand Down Expand Up @@ -67,7 +67,7 @@ let
'' +
''
machine.succeed(
"gnome-desktop-testing-runner ${testRunnerFlags} -d '${tested.installedTests}/share'"
"gnome-desktop-testing-runner ${escapeShellArgs testRunnerFlags} -d '${tested.installedTests}/share'"
)
'';
}
Expand Down
2 changes: 1 addition & 1 deletion nixos/tests/installed-tests/flatpak-builder.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ makeInstalledTest {
virtualisation.diskSize = 2048;
};

testRunnerFlags = "--timeout 3600";
testRunnerFlags = [ "--timeout" "3600" ];
}
2 changes: 1 addition & 1 deletion nixos/tests/installed-tests/flatpak.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ makeInstalledTest {
virtualisation.diskSize = 3072;
};

testRunnerFlags = "--timeout 3600";
testRunnerFlags = [ "--timeout" "3600" ];
}
2 changes: 1 addition & 1 deletion nixos/tests/installed-tests/gdk-pixbuf.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ makeInstalledTest {
virtualisation.memorySize = if pkgs.stdenv.isi686 then 2047 else 4096;
};

testRunnerFlags = "--timeout 1800";
testRunnerFlags = [ "--timeout" "1800" ];
}
41 changes: 22 additions & 19 deletions nixos/tests/k3s/multi-node.nix
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ import ../make-test-python.nix ({ pkgs, lib, ... }:
role = "server";
package = pkgs.k3s;
clusterInit = true;
extraFlags = ''
--disable coredns \
--disable local-storage \
--disable metrics-server \
--disable servicelb \
--disable traefik \
--node-ip 192.168.1.1 \
--pause-image test.local/pause:local
'';
extraFlags = builtins.toString [
"--disable" "coredns"
"--disable" "local-storage"
"--disable" "metrics-server"
"--disable" "servicelb"
"--disable" "traefik"
"--node-ip" "192.168.1.1"
"--pause-image" "test.local/pause:local"
];
};
networking.firewall.allowedTCPPorts = [ 2379 2380 6443 ];
networking.firewall.allowedUDPPorts = [ 8472 ];
Expand All @@ -84,15 +84,15 @@ import ../make-test-python.nix ({ pkgs, lib, ... }:
enable = true;
serverAddr = "https://192.168.1.1:6443";
clusterInit = false;
extraFlags = ''
--disable coredns \
--disable local-storage \
--disable metrics-server \
--disable servicelb \
--disable traefik \
--node-ip 192.168.1.3 \
--pause-image test.local/pause:local
'';
extraFlags = builtins.toString [
"--disable" "coredns"
"--disable" "local-storage"
"--disable" "metrics-server"
"--disable" "servicelb"
"--disable" "traefik"
"--node-ip" "192.168.1.3"
"--pause-image" "test.local/pause:local"
];
};
networking.firewall.allowedTCPPorts = [ 2379 2380 6443 ];
networking.firewall.allowedUDPPorts = [ 8472 ];
Expand All @@ -112,7 +112,10 @@ import ../make-test-python.nix ({ pkgs, lib, ... }:
enable = true;
role = "agent";
serverAddr = "https://192.168.1.3:6443";
extraFlags = "--pause-image test.local/pause:local --node-ip 192.168.1.2";
extraFlags = lib.toString [
"--pause-image" "test.local/pause:local"
"--node-ip" "192.168.1.2"
];
};
networking.firewall.allowedTCPPorts = [ 6443 ];
networking.firewall.allowedUDPPorts = [ 8472 ];
Expand Down
17 changes: 8 additions & 9 deletions nixos/tests/k3s/single-node.nix
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,14 @@ import ../make-test-python.nix ({ pkgs, lib, ... }:
services.k3s.role = "server";
services.k3s.package = pkgs.k3s;
# Slightly reduce resource usage
services.k3s.extraFlags = ''
--disable coredns \
--disable local-storage \
--disable metrics-server \
--disable servicelb \
--disable traefik \
--pause-image \
test.local/pause:local
'';
services.k3s.extraFlags = builtins.toString [
"--disable" "coredns"
"--disable" "local-storage"
"--disable" "metrics-server"
"--disable" "servicelb"
"--disable" "traefik"
"--pause-image" "test.local/pause:local"
];

users.users = {
noprivs = {
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/audio/chuck/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ stdenv.mkDerivation rec {

buildInputs = [ libsndfile ]
++ lib.optional (!stdenv.isDarwin) alsa-lib
++ lib.optional stdenv.isDarwin [ AppKit Carbon CoreAudio CoreMIDI CoreServices Kernel ];
++ lib.optionals stdenv.isDarwin [ AppKit Carbon CoreAudio CoreMIDI CoreServices Kernel ];

patches = [ ./darwin-limits.patch ];

Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/audio/grandorgue/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
buildInputs = [ fftwFloat alsa-lib zlib wavpack wxGTK31 udev ]
++ lib.optional jackaudioSupport libjack2;

cmakeFlags = lib.optional (!jackaudioSupport) [
cmakeFlags = lib.optionals (!jackaudioSupport) [
"-DRTAUDIO_USE_JACK=OFF"
"-DRTMIDI_USE_JACK=OFF"
] ++ lib.optional (!includeDemo) "-DINSTALL_DEMO=OFF";
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/audio/snapcast/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
aixlog popl soxr
] ++ lib.optional pulseaudioSupport libpulseaudio
++ lib.optional stdenv.isLinux alsa-lib
++ lib.optional stdenv.isDarwin [darwin.apple_sdk.frameworks.IOKit darwin.apple_sdk.frameworks.AudioToolbox];
++ lib.optionals stdenv.isDarwin [darwin.apple_sdk.frameworks.IOKit darwin.apple_sdk.frameworks.AudioToolbox];

TARGET=lib.optionalString stdenv.isDarwin "MACOS";

Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/blockchains/openethereum/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ rustPlatform.buildRustPackage rec {

# Exclude some tests that don't work in the sandbox
# - Nat test requires network access
checkFlags = "--skip configuration::tests::should_resolve_external_nat_hosts";
checkFlags = [ "--skip" "configuration::tests::should_resolve_external_nat_hosts" ];

meta = with lib; {
broken = stdenv.isDarwin;
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/blockchains/polkadot/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ rustPlatform.buildRustPackage rec {

cargoSha256 = "sha256-mI8VvTlM9ynstDBC0ubQkzg3D2ZXuWqJGS/Y23D6dU0=";

buildInputs = lib.optional stdenv.isDarwin [ Security ];
buildInputs = lib.optionals stdenv.isDarwin [ Security ];

nativeBuildInputs = [ clang ];

Expand Down
4 changes: 2 additions & 2 deletions pkgs/applications/editors/rstudio/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ in
makeWrapper
pandoc
nodejs
] ++ lib.optional (!server) [
] ++ lib.optionals (!server) [
copyDesktopItems
];

Expand Down Expand Up @@ -118,7 +118,7 @@ in
"-DQUARTO_ENABLED=FALSE"
"-DPANDOC_VERSION=${pandoc.version}"
"-DCMAKE_INSTALL_PREFIX=${placeholder "out"}/lib/rstudio"
] ++ lib.optional (!server) [
] ++ lib.optionals (!server) [
"-DQT_QMAKE_EXECUTABLE=${qmake}/bin/qmake"
];

Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/editors/vim/configurable.nix
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ in stdenv.mkDerivation rec {
++ lib.optionals luaSupport [
"--with-lua-prefix=${lua}"
"--enable-luainterp"
] ++ lib.optional lua.pkgs.isLuaJIT [
] ++ lib.optionals lua.pkgs.isLuaJIT [
"--with-luajit"
]
++ lib.optionals pythonSupport [
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/editors/vscode/generic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ let
buildInputs = [ libsecret libXScrnSaver libxshmfence ]
++ lib.optionals (!stdenv.isDarwin) ([ at-spi2-atk ] ++ atomEnv.packages);

runtimeDependencies = lib.optional stdenv.isLinux [ (lib.getLib systemd) fontconfig.lib libdbusmenu ];
runtimeDependencies = lib.optionals stdenv.isLinux [ (lib.getLib systemd) fontconfig.lib libdbusmenu ];

nativeBuildInputs = [ unzip ]
++ lib.optionals stdenv.isLinux [
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/emulators/retroarch/cores.nix
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ in
description = "Fast MegaDrive/MegaCD/32X emulator";
license = "MAME";
dontConfigure = true;
makeFlags = lib.optional stdenv.hostPlatform.isAarch64 [ "platform=aarch64" ];
makeFlags = lib.optionals stdenv.hostPlatform.isAarch64 [ "platform=aarch64" ];
};

play = mkLibRetroCore {
Expand Down
4 changes: 2 additions & 2 deletions pkgs/applications/file-managers/nnn/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ stdenv.mkDerivation rec {
NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isMusl "-lfts";

makeFlags = [ "PREFIX=${placeholder "out"}" ]
++ lib.optional withIcons [ "O_ICONS=1" ]
++ lib.optional withNerdIcons [ "O_NERD=1" ];
++ lib.optionals withIcons [ "O_ICONS=1" ]
++ lib.optionals withNerdIcons [ "O_NERD=1" ];

binPath = lib.makeBinPath [ file which ];

Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/gis/gmt/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ stdenv.mkDerivation rec {
"-DGMT_INSTALL_MODULE_LINKS:BOOL=FALSE"
"-DLICENSE_RESTRICTED=LGPL" # "GPL" and "no" also valid
] ++ (with stdenv;
lib.optional (!isDarwin) [
lib.optionals (!isDarwin) [
"-DFFTW3_ROOT=${fftwSinglePrec.dev}"
"-DLAPACK_LIBRARY=${lapack}/lib/liblapack.so"
"-DBLAS_LIBRARY=${blas}/lib/libblas.so"
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/graphics/kcc/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ mkDerivationWith python3Packages.buildPythonApplication rec {
raven
];

qtWrapperArgs = lib.optional archiveSupport [ "--prefix" "PATH" ":" "${ lib.makeBinPath [ p7zip ] }" ];
qtWrapperArgs = lib.optionals archiveSupport [ "--prefix" "PATH" ":" "${ lib.makeBinPath [ p7zip ] }" ];

postFixup = ''
wrapProgram $out/bin/kcc "''${qtWrapperArgs[@]}"
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/graphics/xournalpp/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ stdenv.mkDerivation rec {
]
++ lib.optional withLua lua;

buildFlags = "translations";
buildFlags = [ "translations" ];

hardeningDisable = [ "format" ];

Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/misc/audio/sox/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [
autoreconfHook
autoconf-archive
] ++ lib.optional enableOpusfile [
] ++ lib.optionals enableOpusfile [
# configure.ac uses pkg-config only to locate libopusfile
pkg-config
];
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/misc/blender/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ stdenv.mkDerivation rec {
# Clang doesn't support "-export-dynamic"
++ optional stdenv.cc.isClang "-DPYTHON_LINKFLAGS="
++ optional jackaudioSupport "-DWITH_JACK=ON"
++ optional cudaSupport [
++ optionals cudaSupport [
"-DWITH_CYCLES_CUDA_BINARIES=ON"
"-DWITH_CYCLES_DEVICE_OPTIX=ON"
"-DOPTIX_ROOT_DIR=${optix}"
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/networking/browsers/links2/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
[ libev librsvg libpng libjpeg libtiff openssl xz bzip2 zlib ]
++ optionals stdenv.isLinux [ gpm ]
++ optionals enableX11 [ libX11 libXau libXt ]
++ optional enableDirectFB [ directfb ];
++ optionals enableDirectFB [ directfb ];

nativeBuildInputs = [ pkg-config bzip2 ];

Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/networking/cluster/hadoop/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ let
doCheck = true;

nativeBuildInputs = [ makeWrapper ]
++ optional (stdenv.isLinux && (nativeLibs != [ ] || libPatches != "")) [ autoPatchelfHook ];
++ optionals (stdenv.isLinux && (nativeLibs != [ ] || libPatches != "")) [ autoPatchelfHook ];
buildInputs = [ openssl ] ++ nativeLibs;

installPhase = ''
Expand Down
Loading