summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorSebastián Mancilla <smancill@smancill.dev>2021-08-17 20:14:20 -0400
committerSebastián Mancilla <smancill@smancill.dev>2021-08-20 19:08:42 -0400
commit8f94a33b38fdd8b5e1c3e57303855364887ec332 (patch)
treeb2482923cda2bb402fdde538e52dd021bf728d60 /pkgs
parent1d87f9866c857b72f60eb6c9f7f4701a38ac2136 (diff)
downloadnixpkgs-8f94a33b38fdd8b5e1c3e57303855364887ec332.tar
nixpkgs-8f94a33b38fdd8b5e1c3e57303855364887ec332.tar.gz
nixpkgs-8f94a33b38fdd8b5e1c3e57303855364887ec332.tar.bz2
nixpkgs-8f94a33b38fdd8b5e1c3e57303855364887ec332.tar.lz
nixpkgs-8f94a33b38fdd8b5e1c3e57303855364887ec332.tar.xz
nixpkgs-8f94a33b38fdd8b5e1c3e57303855364887ec332.tar.zst
nixpkgs-8f94a33b38fdd8b5e1c3e57303855364887ec332.zip
treewide: ensure pre/post phase hooks are strings
Some derivations use lib.optional or lib.optionals when setting pre/post
phase hooks. Ensure the proper lib.optionalString is used.
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/applications/audio/zynaddsubfx/default.nix2
-rw-r--r--pkgs/applications/blockchains/bitcoin/default.nix2
-rw-r--r--pkgs/applications/graphics/rx/default.nix2
-rw-r--r--pkgs/applications/misc/waybar/default.nix2
-rw-r--r--pkgs/applications/misc/wmname/default.nix2
-rw-r--r--pkgs/applications/networking/mumble/default.nix2
-rw-r--r--pkgs/applications/science/biology/neuron/default.nix4
-rw-r--r--pkgs/applications/science/electronics/kicad/base.nix4
-rw-r--r--pkgs/applications/science/physics/sherpa/default.nix2
-rw-r--r--pkgs/applications/system/glances/default.nix2
-rw-r--r--pkgs/development/compilers/vala/default.nix2
-rw-r--r--pkgs/development/libraries/flatbuffers/1.12.nix2
-rw-r--r--pkgs/development/libraries/libfm/default.nix4
-rw-r--r--pkgs/development/libraries/mbedtls/default.nix2
-rw-r--r--pkgs/development/libraries/silgraphite/graphite2.nix2
-rw-r--r--pkgs/development/libraries/t1lib/default.nix2
-rw-r--r--pkgs/development/libraries/zeroc-ice/3.6.nix2
-rw-r--r--pkgs/development/libraries/zeroc-ice/default.nix2
-rw-r--r--pkgs/development/python-modules/cmd2/default.nix2
-rw-r--r--pkgs/development/python-modules/cvxpy/default.nix2
-rw-r--r--pkgs/development/python-modules/spacy/models.nix2
-rw-r--r--pkgs/development/tools/build-managers/cmake/default.nix2
-rw-r--r--pkgs/development/tools/parsing/flex/2.5.35.nix8
-rw-r--r--pkgs/development/tools/parsing/flex/2.6.1.nix8
-rw-r--r--pkgs/development/tools/parsing/flex/default.nix8
-rw-r--r--pkgs/development/tools/parsing/ragel/default.nix2
-rw-r--r--pkgs/development/tools/qtcreator/default.nix2
-rw-r--r--pkgs/misc/vim-plugins/overrides.nix2
-rw-r--r--pkgs/os-specific/linux/iptables/default.nix2
-rw-r--r--pkgs/servers/klipper/default.nix2
-rw-r--r--pkgs/servers/sql/mysql/5.7.x.nix2
-rw-r--r--pkgs/tools/filesystems/moosefs/default.nix2
-rw-r--r--pkgs/tools/networking/dhcpcd/default.nix2
33 files changed, 45 insertions, 45 deletions
diff --git a/pkgs/applications/audio/zynaddsubfx/default.nix b/pkgs/applications/audio/zynaddsubfx/default.nix
index 986e3215b93..4b3cbb171bd 100644
--- a/pkgs/applications/audio/zynaddsubfx/default.nix
+++ b/pkgs/applications/audio/zynaddsubfx/default.nix
@@ -91,7 +91,7 @@ in stdenv.mkDerivation rec {
 
   # When building with zest GUI, patch plugins
   # and standalone executable to properly locate zest
-  postFixup = lib.optional (guiModule == "zest") ''
+  postFixup = lib.optionalString (guiModule == "zest") ''
     patchelf --set-rpath "${mruby-zest}:$(patchelf --print-rpath "$out/lib/lv2/ZynAddSubFX.lv2/ZynAddSubFX_ui.so")" \
       "$out/lib/lv2/ZynAddSubFX.lv2/ZynAddSubFX_ui.so"
 
diff --git a/pkgs/applications/blockchains/bitcoin/default.nix b/pkgs/applications/blockchains/bitcoin/default.nix
index 00727d294df..8bbeda2e0d4 100644
--- a/pkgs/applications/blockchains/bitcoin/default.nix
+++ b/pkgs/applications/blockchains/bitcoin/default.nix
@@ -53,7 +53,7 @@ stdenv.mkDerivation rec {
     ++ optionals withWallet [ db48 sqlite ]
     ++ optionals withGui [ qrencode qtbase qttools ];
 
-  postInstall = optional withGui ''
+  postInstall = optionalString withGui ''
     install -Dm644 ${desktop} $out/share/applications/bitcoin-qt.desktop
     substituteInPlace $out/share/applications/bitcoin-qt.desktop --replace "Icon=bitcoin128" "Icon=bitcoin"
     install -Dm644 share/pixmaps/bitcoin256.png $out/share/pixmaps/bitcoin.png
diff --git a/pkgs/applications/graphics/rx/default.nix b/pkgs/applications/graphics/rx/default.nix
index a40371ddb46..fe3d10bae63 100644
--- a/pkgs/applications/graphics/rx/default.nix
+++ b/pkgs/applications/graphics/rx/default.nix
@@ -29,7 +29,7 @@ rustPlatform.buildRustPackage rec {
   # FIXME: GLFW (X11) requires DISPLAY env variable for all tests
   doCheck = false;
 
-  postInstall = optional stdenv.isLinux ''
+  postInstall = optionalString stdenv.isLinux ''
     mkdir -p $out/share/applications
     cp $src/rx.desktop $out/share/applications
     wrapProgram $out/bin/rx --prefix LD_LIBRARY_PATH : ${libGL}/lib
diff --git a/pkgs/applications/misc/waybar/default.nix b/pkgs/applications/misc/waybar/default.nix
index 88f0e13e91b..a38c1002a01 100644
--- a/pkgs/applications/misc/waybar/default.nix
+++ b/pkgs/applications/misc/waybar/default.nix
@@ -78,7 +78,7 @@ stdenv.mkDerivation rec {
     "-Dman-pages=enabled"
   ];
 
-  preFixup = lib.optional withMediaPlayer ''
+  preFixup = lib.optionalString withMediaPlayer ''
       cp $src/resources/custom_modules/mediaplayer.py $out/bin/waybar-mediaplayer.py
 
       wrapProgram $out/bin/waybar-mediaplayer.py \
diff --git a/pkgs/applications/misc/wmname/default.nix b/pkgs/applications/misc/wmname/default.nix
index d501869770e..cb4f5ec3442 100644
--- a/pkgs/applications/misc/wmname/default.nix
+++ b/pkgs/applications/misc/wmname/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ libX11 ];
 
-  preConfigure = [ ''sed -i "s@PREFIX = /usr/local@PREFIX = $out@g" config.mk'' ];
+  preConfigure = ''sed -i "s@PREFIX = /usr/local@PREFIX = $out@g" config.mk'';
 
   meta = {
     description = "Prints or set the window manager name property of the root window";
diff --git a/pkgs/applications/networking/mumble/default.nix b/pkgs/applications/networking/mumble/default.nix
index d93fea1f702..c7500d90328 100644
--- a/pkgs/applications/networking/mumble/default.nix
+++ b/pkgs/applications/networking/mumble/default.nix
@@ -104,7 +104,7 @@ let
   server = source: generic {
     type = "murmur";
 
-    postPatch = lib.optional iceSupport ''
+    postPatch = lib.optionalString iceSupport ''
       grep -Rl '/usr/share/Ice' . | xargs sed -i 's,/usr/share/Ice/,${zeroc-ice.dev}/share/ice/,g'
     '';
 
diff --git a/pkgs/applications/science/biology/neuron/default.nix b/pkgs/applications/science/biology/neuron/default.nix
index 7bfef3a82fe..804407968e1 100644
--- a/pkgs/applications/science/biology/neuron/default.nix
+++ b/pkgs/applications/science/biology/neuron/default.nix
@@ -60,13 +60,13 @@ stdenv.mkDerivation rec {
                         else ["--without-mpi"]);
 
 
-  postInstall = lib.optionals (python != null) [ ''
+  postInstall = lib.optionalString (python != null) ''
     ## standardise python neuron install dir if any
     if [[ -d $out/lib/python ]]; then
         mkdir -p ''${out}/${python.sitePackages}
         mv ''${out}/lib/python/*  ''${out}/${python.sitePackages}/
     fi
-  ''];
+  '';
 
   propagatedBuildInputs = [ readline ncurses which libtool ];
 
diff --git a/pkgs/applications/science/electronics/kicad/base.nix b/pkgs/applications/science/electronics/kicad/base.nix
index 596083c2709..d7398f39ec4 100644
--- a/pkgs/applications/science/electronics/kicad/base.nix
+++ b/pkgs/applications/science/electronics/kicad/base.nix
@@ -64,7 +64,7 @@ assert lib.assertMsg (!(sanitizeAddress && sanitizeThreads))
   "'sanitizeAddress' and 'sanitizeThreads' are mutually exclusive, use one.";
 
 let
-  inherit (lib) optional optionals;
+  inherit (lib) optional optionals optionalString;
 in
 stdenv.mkDerivation rec {
   pname = "kicad-base";
@@ -172,7 +172,7 @@ stdenv.mkDerivation rec {
 
   dontStrip = debug;
 
-  postInstall = optional (withI18n) ''
+  postInstall = optionalString (withI18n) ''
     mkdir -p $out/share
     lndir ${i18n}/share $out/share
   '';
diff --git a/pkgs/applications/science/physics/sherpa/default.nix b/pkgs/applications/science/physics/sherpa/default.nix
index ba519cc2d03..eb718be12e4 100644
--- a/pkgs/applications/science/physics/sherpa/default.nix
+++ b/pkgs/applications/science/physics/sherpa/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "1iwa17s8ipj6a2b8zss5csb1k5y9s5js38syvq932rxcinbyjsl4";
   };
 
-  postPatch = lib.optional (stdenv.hostPlatform.libc == "glibc") ''
+  postPatch = lib.optionalString (stdenv.hostPlatform.libc == "glibc") ''
     sed -ie '/sys\/sysctl.h/d' ATOOLS/Org/Run_Parameter.C
   '';
 
diff --git a/pkgs/applications/system/glances/default.nix b/pkgs/applications/system/glances/default.nix
index 8ddee9c0b49..6c2e5a8443b 100644
--- a/pkgs/applications/system/glances/default.nix
+++ b/pkgs/applications/system/glances/default.nix
@@ -31,7 +31,7 @@ buildPythonApplication rec {
   ];
 
   doCheck = true;
-  preCheck = lib.optional stdenv.isDarwin ''
+  preCheck = lib.optionalString stdenv.isDarwin ''
     export DYLD_FRAMEWORK_PATH=/System/Library/Frameworks
   '';
 
diff --git a/pkgs/development/compilers/vala/default.nix b/pkgs/development/compilers/vala/default.nix
index bd001d5a10e..8f93a6746ea 100644
--- a/pkgs/development/compilers/vala/default.nix
+++ b/pkgs/development/compilers/vala/default.nix
@@ -69,7 +69,7 @@ let
     # so that it can be used to regenerate documentation.
     patches        = lib.optionals disableGraphviz [ graphvizPatch ./gvc-compat.patch ];
     configureFlags = lib.optional  disableGraphviz "--disable-graphviz";
-    preBuild       = lib.optional  disableGraphviz "buildFlagsArray+=(\"VALAC=$(pwd)/compiler/valac\")";
+    preBuild       = lib.optionalString disableGraphviz "buildFlagsArray+=(\"VALAC=$(pwd)/compiler/valac\")";
 
     outputs = [ "out" "devdoc" ];
 
diff --git a/pkgs/development/libraries/flatbuffers/1.12.nix b/pkgs/development/libraries/flatbuffers/1.12.nix
index df2980ba204..1ad490d3a01 100644
--- a/pkgs/development/libraries/flatbuffers/1.12.nix
+++ b/pkgs/development/libraries/flatbuffers/1.12.nix
@@ -20,7 +20,7 @@ callPackage ./generic.nix {
     })
   ];
 
-  preConfigure = lib.optional stdenv.buildPlatform.isDarwin ''
+  preConfigure = lib.optionalString stdenv.buildPlatform.isDarwin ''
     rm BUILD
   '';
 }
diff --git a/pkgs/development/libraries/libfm/default.nix b/pkgs/development/libraries/libfm/default.nix
index 255ddfa22ad..5d7389b6d18 100644
--- a/pkgs/development/libraries/libfm/default.nix
+++ b/pkgs/development/libraries/libfm/default.nix
@@ -13,7 +13,7 @@
 
 let
     gtk = if withGtk3 then gtk3 else gtk2;
-    inherit (lib) optional;
+    inherit (lib) optional optionalString;
 in
 stdenv.mkDerivation rec {
   pname = if extraOnly
@@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
   installFlags = [ "sysconfdir=${placeholder "out"}/etc" ];
 
   # libfm-extra is pulled in by menu-cache and thus leads to a collision for libfm
-  postInstall = optional (!extraOnly) ''
+  postInstall = optionalString (!extraOnly) ''
      rm $out/lib/libfm-extra.so $out/lib/libfm-extra.so.* $out/lib/libfm-extra.la $out/lib/pkgconfig/libfm-extra.pc
   '';
 
diff --git a/pkgs/development/libraries/mbedtls/default.nix b/pkgs/development/libraries/mbedtls/default.nix
index 90e2c9bd9a7..9210f18ed96 100644
--- a/pkgs/development/libraries/mbedtls/default.nix
+++ b/pkgs/development/libraries/mbedtls/default.nix
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
 
   strictDeps = true;
 
-  postConfigure = lib.optionals enableThreading ''
+  postConfigure = lib.optionalString enableThreading ''
     perl scripts/config.pl set MBEDTLS_THREADING_C    # Threading abstraction layer
     perl scripts/config.pl set MBEDTLS_THREADING_PTHREAD    # POSIX thread wrapper layer for the threading layer.
   '';
diff --git a/pkgs/development/libraries/silgraphite/graphite2.nix b/pkgs/development/libraries/silgraphite/graphite2.nix
index 25f4b5e1317..b047d687074 100644
--- a/pkgs/development/libraries/silgraphite/graphite2.nix
+++ b/pkgs/development/libraries/silgraphite/graphite2.nix
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
 
   # Remove a test that fails to statically link (undefined reference to png and
   # freetype symbols)
-  postConfigure = lib.optionals static ''
+  postConfigure = lib.optionalString static ''
     sed -e '/freetype freetype.c/d' -i ../tests/examples/CMakeLists.txt
   '';
 
diff --git a/pkgs/development/libraries/t1lib/default.nix b/pkgs/development/libraries/t1lib/default.nix
index 495993a64ab..5bd4b02b61d 100644
--- a/pkgs/development/libraries/t1lib/default.nix
+++ b/pkgs/development/libraries/t1lib/default.nix
@@ -28,7 +28,7 @@ stdenv.mkDerivation {
   buildInputs = [ libX11 libXaw ];
   buildFlags = [ "without_doc" ];
 
-  postInstall = lib.optional (!stdenv.isDarwin) "chmod +x $out/lib/*.so.*"; # ??
+  postInstall = lib.optionalString (!stdenv.isDarwin) "chmod +x $out/lib/*.so.*"; # ??
 
   meta = with lib; {
     description = "A type 1 font rasterizer library for UNIX/X11";
diff --git a/pkgs/development/libraries/zeroc-ice/3.6.nix b/pkgs/development/libraries/zeroc-ice/3.6.nix
index 896973e32eb..725af51487c 100644
--- a/pkgs/development/libraries/zeroc-ice/3.6.nix
+++ b/pkgs/development/libraries/zeroc-ice/3.6.nix
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
     sourceRoot=$sourceRoot/cpp
   '';
 
-  prePatch = lib.optional stdenv.isDarwin ''
+  prePatch = lib.optionalString stdenv.isDarwin ''
     substituteInPlace config/Make.rules.Darwin \
         --replace xcrun ""
   '';
diff --git a/pkgs/development/libraries/zeroc-ice/default.nix b/pkgs/development/libraries/zeroc-ice/default.nix
index ef16e381bcf..f522c181039 100644
--- a/pkgs/development/libraries/zeroc-ice/default.nix
+++ b/pkgs/development/libraries/zeroc-ice/default.nix
@@ -35,7 +35,7 @@ in stdenv.mkDerivation rec {
 
   NIX_CFLAGS_COMPILE = "-Wno-error=class-memaccess -Wno-error=deprecated-copy";
 
-  prePatch = lib.optional stdenv.isDarwin ''
+  prePatch = lib.optionalString stdenv.isDarwin ''
     substituteInPlace Make.rules.Darwin \
         --replace xcrun ""
   '';
diff --git a/pkgs/development/python-modules/cmd2/default.nix b/pkgs/development/python-modules/cmd2/default.nix
index dee6c2ab499..b5bbc88c341 100644
--- a/pkgs/development/python-modules/cmd2/default.nix
+++ b/pkgs/development/python-modules/cmd2/default.nix
@@ -15,7 +15,7 @@ buildPythonPackage rec {
 
   LC_ALL="en_US.UTF-8";
 
-  postPatch = lib.optional stdenv.isDarwin ''
+  postPatch = lib.optionalString stdenv.isDarwin ''
     # Fake the impure dependencies pbpaste and pbcopy
     mkdir bin
     echo '#!${stdenv.shell}' > bin/pbpaste
diff --git a/pkgs/development/python-modules/cvxpy/default.nix b/pkgs/development/python-modules/cvxpy/default.nix
index 9068814ffd7..b7b5c7f55af 100644
--- a/pkgs/development/python-modules/cvxpy/default.nix
+++ b/pkgs/development/python-modules/cvxpy/default.nix
@@ -36,7 +36,7 @@ buildPythonPackage rec {
   ];
 
   # Required flags from https://github.com/cvxgrp/cvxpy/releases/tag/v1.1.11
-  preBuild = lib.optional useOpenmp ''
+  preBuild = lib.optionalString useOpenmp ''
     export CFLAGS="-fopenmp"
     export LDFLAGS="-lgomp"
   '';
diff --git a/pkgs/development/python-modules/spacy/models.nix b/pkgs/development/python-modules/spacy/models.nix
index c34bbdfb83d..0e0f1f19640 100644
--- a/pkgs/development/python-modules/spacy/models.nix
+++ b/pkgs/development/python-modules/spacy/models.nix
@@ -25,7 +25,7 @@ let
       ++ lib.optionals (lang == "ru") [ pymorphy2 ]
       ++ lib.optionals (pname == "fr_dep_news_trf") [ sentencepiece ];
 
-    postPatch = lib.optionals (pname == "fr_dep_news_trf") ''
+    postPatch = lib.optionalString (pname == "fr_dep_news_trf") ''
       substituteInPlace meta.json \
         --replace "sentencepiece==0.1.91" "sentencepiece>=0.1.91"
     '';
diff --git a/pkgs/development/tools/build-managers/cmake/default.nix b/pkgs/development/tools/build-managers/cmake/default.nix
index 2de586f97cb..a29ac38eb13 100644
--- a/pkgs/development/tools/build-managers/cmake/default.nix
+++ b/pkgs/development/tools/build-managers/cmake/default.nix
@@ -102,7 +102,7 @@ stdenv.mkDerivation rec {
   ];
 
   # make install attempts to use the just-built cmake
-  preInstall = lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) ''
+  preInstall = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
     sed -i 's|bin/cmake|${buildPackages.cmakeMinimal}/bin/cmake|g' Makefile
   '';
 
diff --git a/pkgs/development/tools/parsing/flex/2.5.35.nix b/pkgs/development/tools/parsing/flex/2.5.35.nix
index b2245ff9c9b..ec2c9eeb2d1 100644
--- a/pkgs/development/tools/parsing/flex/2.5.35.nix
+++ b/pkgs/development/tools/parsing/flex/2.5.35.nix
@@ -16,10 +16,10 @@ stdenv.mkDerivation {
 
   propagatedBuildInputs = [ m4 ];
 
-  preConfigure = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
-    "ac_cv_func_malloc_0_nonnull=yes"
-    "ac_cv_func_realloc_0_nonnull=yes"
-  ];
+  preConfigure = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
+    ac_cv_func_malloc_0_nonnull=yes
+    ac_cv_func_realloc_0_nonnull=yes
+  '';
 
   doCheck = false; # fails 2 out of 46 tests
 
diff --git a/pkgs/development/tools/parsing/flex/2.6.1.nix b/pkgs/development/tools/parsing/flex/2.6.1.nix
index cc0ecb148c4..aeb14164977 100644
--- a/pkgs/development/tools/parsing/flex/2.6.1.nix
+++ b/pkgs/development/tools/parsing/flex/2.6.1.nix
@@ -18,10 +18,10 @@ stdenv.mkDerivation {
 
   propagatedBuildInputs = [ m4 ];
 
-  preConfigure = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
-    "ac_cv_func_malloc_0_nonnull=yes"
-    "ac_cv_func_realloc_0_nonnull=yes"
-  ];
+  preConfigure = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
+    ac_cv_func_malloc_0_nonnull=yes
+    ac_cv_func_realloc_0_nonnull=yes
+  '';
 
   postConfigure = lib.optionalString (stdenv.isDarwin || stdenv.isCygwin) ''
     sed -i Makefile -e 's/-no-undefined//;'
diff --git a/pkgs/development/tools/parsing/flex/default.nix b/pkgs/development/tools/parsing/flex/default.nix
index 0bc26db5750..e0895bab68d 100644
--- a/pkgs/development/tools/parsing/flex/default.nix
+++ b/pkgs/development/tools/parsing/flex/default.nix
@@ -33,10 +33,10 @@ stdenv.mkDerivation rec {
   buildInputs = [ bison ];
   propagatedBuildInputs = [ m4 ];
 
-  preConfigure = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
-    "export ac_cv_func_malloc_0_nonnull=yes"
-    "export ac_cv_func_realloc_0_nonnull=yes"
-  ];
+  preConfigure = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
+    export ac_cv_func_malloc_0_nonnull=yes
+    export ac_cv_func_realloc_0_nonnull=yes
+  '';
 
   postConfigure = lib.optionalString (stdenv.isDarwin || stdenv.isCygwin) ''
     sed -i Makefile -e 's/-no-undefined//;'
diff --git a/pkgs/development/tools/parsing/ragel/default.nix b/pkgs/development/tools/parsing/ragel/default.nix
index 6bbcf36cd2c..c23b352dece 100644
--- a/pkgs/development/tools/parsing/ragel/default.nix
+++ b/pkgs/development/tools/parsing/ragel/default.nix
@@ -15,7 +15,7 @@ let
 
       buildInputs = lib.optional build-manual [ transfig ghostscript tex ];
 
-      preConfigure = lib.optional build-manual ''
+      preConfigure = lib.optionalString build-manual ''
         sed -i "s/build_manual=no/build_manual=yes/g" DIST
       '';
 
diff --git a/pkgs/development/tools/qtcreator/default.nix b/pkgs/development/tools/qtcreator/default.nix
index 5926b3fda5e..9df547308f5 100644
--- a/pkgs/development/tools/qtcreator/default.nix
+++ b/pkgs/development/tools/qtcreator/default.nix
@@ -68,7 +68,7 @@ mkDerivation rec {
       --replace 'LLVM_CXXFLAGS ~= s,-gsplit-dwarf,' '${lib.concatStringsSep "\n" ["LLVM_CXXFLAGS ~= s,-gsplit-dwarf," "    LLVM_CXXFLAGS += -fno-rtti"]}'
   '';
 
-  preBuild = optional withDocumentation ''
+  preBuild = optionalString withDocumentation ''
     ln -s ${getLib qtbase}/$qtDocPrefix $NIX_QT5_TMP/share
   '';
 
diff --git a/pkgs/misc/vim-plugins/overrides.nix b/pkgs/misc/vim-plugins/overrides.nix
index bd977960f42..f26258de3ba 100644
--- a/pkgs/misc/vim-plugins/overrides.nix
+++ b/pkgs/misc/vim-plugins/overrides.nix
@@ -834,7 +834,7 @@ self: super: {
   });
 
   vim-xdebug = super.vim-xdebug.overrideAttrs (old: {
-    postInstall = false;
+    postInstall = null;
   });
 
   vim-xkbswitch = super.vim-xkbswitch.overrideAttrs (old: {
diff --git a/pkgs/os-specific/linux/iptables/default.nix b/pkgs/os-specific/linux/iptables/default.nix
index 912d9078c94..fe0e82c4a8e 100644
--- a/pkgs/os-specific/linux/iptables/default.nix
+++ b/pkgs/os-specific/linux/iptables/default.nix
@@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
 
   outputs = [ "out" "dev" ];
 
-  postInstall = optional nftablesCompat ''
+  postInstall = optionalString nftablesCompat ''
     rm $out/sbin/{iptables,iptables-restore,iptables-save,ip6tables,ip6tables-restore,ip6tables-save}
     ln -sv xtables-nft-multi $out/bin/iptables
     ln -sv xtables-nft-multi $out/bin/iptables-restore
diff --git a/pkgs/servers/klipper/default.nix b/pkgs/servers/klipper/default.nix
index f120454ac84..aa933b0fb66 100644
--- a/pkgs/servers/klipper/default.nix
+++ b/pkgs/servers/klipper/default.nix
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
   };
 
   # We have no LTO on i686 since commit 22284b0
-  postPatch = lib.optional stdenv.isi686 ''
+  postPatch = lib.optionalString stdenv.isi686 ''
     substituteInPlace chelper/__init__.py \
       --replace "-flto -fwhole-program " ""
   '';
diff --git a/pkgs/servers/sql/mysql/5.7.x.nix b/pkgs/servers/sql/mysql/5.7.x.nix
index 36e26d38fc4..c1ce4d9e1e1 100644
--- a/pkgs/servers/sql/mysql/5.7.x.nix
+++ b/pkgs/servers/sql/mysql/5.7.x.nix
@@ -16,7 +16,7 @@ self = stdenv.mkDerivation rec {
     sha256 = "1fhv16zr46pxm1j8vb8x8mh3nwzglg01arz8gnazbmjqldr5idpq";
   };
 
-  preConfigure = lib.optional stdenv.isDarwin ''
+  preConfigure = lib.optionalString stdenv.isDarwin ''
     ln -s /bin/ps $TMPDIR/ps
     export PATH=$PATH:$TMPDIR
   '';
diff --git a/pkgs/tools/filesystems/moosefs/default.nix b/pkgs/tools/filesystems/moosefs/default.nix
index e07ca270b5c..dc1d77bfa7e 100644
--- a/pkgs/tools/filesystems/moosefs/default.nix
+++ b/pkgs/tools/filesystems/moosefs/default.nix
@@ -35,7 +35,7 @@ stdenv.mkDerivation rec {
       "/usr/local/lib/pkgconfig" "/nonexistent"
   '';
 
-  preBuild = lib.optional stdenv.isDarwin ''
+  preBuild = lib.optionalString stdenv.isDarwin ''
     substituteInPlace config.h --replace \
       "#define HAVE_STRUCT_STAT_ST_BIRTHTIME 1" \
       "#undef HAVE_STRUCT_STAT_ST_BIRTHTIME"
diff --git a/pkgs/tools/networking/dhcpcd/default.nix b/pkgs/tools/networking/dhcpcd/default.nix
index cc1bad106f7..0962335ad1a 100644
--- a/pkgs/tools/networking/dhcpcd/default.nix
+++ b/pkgs/tools/networking/dhcpcd/default.nix
@@ -44,7 +44,7 @@ stdenv.mkDerivation rec {
   installFlags = [ "DBDIR=$(TMPDIR)/db" "SYSCONFDIR=${placeholder "out"}/etc" ];
 
   # Check that the udev plugin got built.
-  postInstall = lib.optional (udev != null) "[ -e ${placeholder "out"}/lib/dhcpcd/dev/udev.so ]";
+  postInstall = lib.optionalString (udev != null) "[ -e ${placeholder "out"}/lib/dhcpcd/dev/udev.so ]";
 
   meta = with lib; {
     description = "A client for the Dynamic Host Configuration Protocol (DHCP)";