summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Buehler <account@buehler.rocks>2023-06-24 20:19:19 +0200
committerFelix Buehler <account@buehler.rocks>2023-06-24 20:19:19 +0200
commitf3719756b550113c1acbbab00c89a56fb77256f2 (patch)
treea94f6678f9b1b25c6773bdd7a35422aabc816032
parente9e3f2e7362aba3ef709173d1777f0b893fc0ebf (diff)
treewide: use optionalString instead of 'then ""'
-rw-r--r--nixos/modules/services/backup/borgbackup.nix2
-rw-r--r--nixos/modules/services/continuous-integration/jenkins/default.nix6
-rw-r--r--nixos/modules/services/misc/cgminer.nix2
-rw-r--r--nixos/modules/services/misc/sourcehut/default.nix6
-rw-r--r--nixos/modules/services/monitoring/prometheus/exporters/pve.nix12
-rw-r--r--nixos/modules/services/networking/biboumi.nix3
-rw-r--r--nixos/modules/services/networking/cjdns.nix2
-rw-r--r--nixos/modules/services/networking/libreswan.nix4
-rw-r--r--nixos/modules/services/networking/murmur.nix20
-rw-r--r--nixos/modules/services/networking/nsd.nix4
-rw-r--r--nixos/modules/services/networking/ssh/lshd.nix4
-rw-r--r--nixos/modules/services/scheduling/fcron.nix2
-rw-r--r--nixos/modules/services/web-apps/invidious.nix2
-rw-r--r--nixos/modules/services/web-apps/invoiceplane.nix2
-rw-r--r--nixos/modules/services/web-apps/peertube.nix2
-rw-r--r--nixos/modules/services/web-servers/lighttpd/cgit.nix2
-rw-r--r--nixos/modules/services/x11/desktop-managers/phosh.nix2
-rw-r--r--nixos/modules/system/boot/kernel_config.nix7
-rw-r--r--nixos/modules/system/boot/loader/grub/grub.nix4
-rw-r--r--nixos/modules/system/boot/systemd/user.nix2
-rw-r--r--pkgs/applications/editors/texmacs/darwin.nix8
-rw-r--r--pkgs/applications/editors/vscode/vscodium.nix2
-rw-r--r--pkgs/applications/networking/browsers/chromium/default.nix4
-rw-r--r--pkgs/applications/networking/browsers/microsoft-edge/browser.nix8
-rw-r--r--pkgs/applications/office/libreoffice/default.nix2
-rw-r--r--pkgs/applications/science/logic/hol_light/default.nix3
-rw-r--r--pkgs/applications/science/math/sage/sage-tests.nix2
-rw-r--r--pkgs/applications/version-management/sapling/default.nix2
-rw-r--r--pkgs/applications/window-managers/sway/wrapper.nix2
-rw-r--r--pkgs/build-support/bintools-wrapper/default.nix16
-rw-r--r--pkgs/build-support/cc-wrapper/default.nix14
-rw-r--r--pkgs/build-support/docker/default.nix2
-rw-r--r--pkgs/build-support/fetchgithub/default.nix2
-rw-r--r--pkgs/build-support/kernel/make-initrd-ng.nix2
-rw-r--r--pkgs/build-support/nix-gitignore/default.nix2
-rw-r--r--pkgs/build-support/rust/build-rust-crate/configure-crate.nix2
-rw-r--r--pkgs/build-support/vm/default.nix2
-rw-r--r--pkgs/data/sgml+xml/stylesheets/xslt/docbook-xsl/default.nix2
-rw-r--r--pkgs/development/compilers/purescript/purescript/default.nix5
-rw-r--r--pkgs/development/interpreters/acl2/libipasirglucose4/default.nix2
-rw-r--r--pkgs/development/interpreters/python/mk-python-derivation.nix2
-rw-r--r--pkgs/development/interpreters/python/wrapper.nix2
-rw-r--r--pkgs/development/libraries/ffmpeg/generic.nix2
-rw-r--r--pkgs/development/libraries/opencv/tests.nix2
-rw-r--r--pkgs/development/libraries/qt-4.x/4.8/default.nix6
-rw-r--r--pkgs/development/mobile/titaniumenv/build-app.nix3
-rw-r--r--pkgs/development/python-modules/azure-common/default.nix2
-rw-r--r--pkgs/development/python-modules/azure-mgmt-common/default.nix2
-rw-r--r--pkgs/development/python-modules/tensorflow/bin.nix2
-rw-r--r--pkgs/development/ruby-modules/bundled-common/default.nix11
-rw-r--r--pkgs/development/ruby-modules/gem/default.nix2
-rw-r--r--pkgs/development/tools/misc/distcc/default.nix2
-rw-r--r--pkgs/os-specific/linux/kernel/manual-config.nix5
53 files changed, 101 insertions, 116 deletions
diff --git a/nixos/modules/services/backup/borgbackup.nix b/nixos/modules/services/backup/borgbackup.nix
index 0da70112d48d..3b44f097ab79 100644
--- a/nixos/modules/services/backup/borgbackup.nix
+++ b/nixos/modules/services/backup/borgbackup.nix
@@ -33,7 +33,7 @@ let
}
trap on_exit EXIT
- archiveName="${if cfg.archiveBaseName == null then "" else cfg.archiveBaseName + "-"}$(date ${cfg.dateFormat})"
+ archiveName="${optionalString (cfg.archiveBaseName != null) (cfg.archiveBaseName + "-")}$(date ${cfg.dateFormat})"
archiveSuffix="${optionalString cfg.appendFailedSuffix ".failed"}"
${cfg.preHook}
'' + optionalString cfg.doInit ''
diff --git a/nixos/modules/services/continuous-integration/jenkins/default.nix b/nixos/modules/services/continuous-integration/jenkins/default.nix
index a9a587b41e88..e4d54b0cb0f4 100644
--- a/nixos/modules/services/continuous-integration/jenkins/default.nix
+++ b/nixos/modules/services/continuous-integration/jenkins/default.nix
@@ -210,9 +210,7 @@ in {
preStart =
let replacePlugins =
- if cfg.plugins == null
- then ""
- else
+ optionalString (cfg.plugins != null) (
let pluginCmds = lib.attrsets.mapAttrsToList
(n: v: "cp ${v} ${cfg.home}/plugins/${n}.jpi")
cfg.plugins;
@@ -220,7 +218,7 @@ in {
rm -r ${cfg.home}/plugins || true
mkdir -p ${cfg.home}/plugins
${lib.strings.concatStringsSep "\n" pluginCmds}
- '';
+ '');
in ''
rm -rf ${cfg.home}/war
${replacePlugins}
diff --git a/nixos/modules/services/misc/cgminer.nix b/nixos/modules/services/misc/cgminer.nix
index fced106cb325..81eb42cbc5de 100644
--- a/nixos/modules/services/misc/cgminer.nix
+++ b/nixos/modules/services/misc/cgminer.nix
@@ -11,7 +11,7 @@ let
mapAttrsToList (n: v: ''"${n}": "${(concatStringsSep "," (map convType v))}"'')
(foldAttrs (n: a: [n] ++ a) [] cfg.hardware);
mergedConfig = with builtins;
- mapAttrsToList (n: v: ''"${n}": ${if isBool v then "" else ''"''}${convType v}${if isBool v then "" else ''"''}'')
+ mapAttrsToList (n: v: ''"${n}": ${if isBool v then (convType v) else ''"${convType v}"''}'')
cfg.config;
cgminerConfig = pkgs.writeText "cgminer.conf" ''
diff --git a/nixos/modules/services/misc/sourcehut/default.nix b/nixos/modules/services/misc/sourcehut/default.nix
index d4391bc49e31..580a009a0ad3 100644
--- a/nixos/modules/services/misc/sourcehut/default.nix
+++ b/nixos/modules/services/misc/sourcehut/default.nix
@@ -8,13 +8,13 @@ let
settingsFormat = pkgs.formats.ini {
listToValue = concatMapStringsSep "," (generators.mkValueStringDefault {});
mkKeyValue = k: v:
- if v == null then ""
- else generators.mkKeyValueDefault {
+ optionalString (v != null)
+ (generators.mkKeyValueDefault {
mkValueString = v:
if v == true then "yes"
else if v == false then "no"
else generators.mkValueStringDefault {} v;
- } "=" k v;
+ } "=" k v);
};
configIniOfService = srv: settingsFormat.generate "sourcehut-${srv}-config.ini"
# Each service needs access to only a subset of sections (and secrets).
diff --git a/nixos/modules/services/monitoring/prometheus/exporters/pve.nix b/nixos/modules/services/monitoring/prometheus/exporters/pve.nix
index e02acad3ecd1..f95412efd7dd 100644
--- a/nixos/modules/services/monitoring/prometheus/exporters/pve.nix
+++ b/nixos/modules/services/monitoring/prometheus/exporters/pve.nix
@@ -104,12 +104,12 @@ in
LoadCredential = "configFile:${computedConfigFile}";
ExecStart = ''
${cfg.package}/bin/pve_exporter \
- --${if cfg.collectors.status == true then "" else "no-"}collector.status \
- --${if cfg.collectors.version == true then "" else "no-"}collector.version \
- --${if cfg.collectors.node == true then "" else "no-"}collector.node \
- --${if cfg.collectors.cluster == true then "" else "no-"}collector.cluster \
- --${if cfg.collectors.resources == true then "" else "no-"}collector.resources \
- --${if cfg.collectors.config == true then "" else "no-"}collector.config \
+ --${optionalString (!cfg.collectors.status) "no-"}collector.status \
+ --${optionalString (!cfg.collectors.version) "no-"}collector.version \
+ --${optionalString (!cfg.collectors.node) "no-"}collector.node \
+ --${optionalString (!cfg.collectors.cluster) "no-"}collector.cluster \
+ --${optionalString (!cfg.collectors.resources) "no-"}collector.resources \
+ --${optionalString (!cfg.collectors.config) "no-"}collector.config \
%d/configFile \
${toString cfg.port} ${cfg.listenAddress}
'';
diff --git a/nixos/modules/services/networking/biboumi.nix b/nixos/modules/services/networking/biboumi.nix
index 1428856764e6..d44a46b35a29 100644
--- a/nixos/modules/services/networking/biboumi.nix
+++ b/nixos/modules/services/networking/biboumi.nix
@@ -8,8 +8,7 @@ let
settingsFile = pkgs.writeText "biboumi.cfg" (
generators.toKeyValue {
mkKeyValue = k: v:
- if v == null then ""
- else generators.mkKeyValueDefault {} "=" k v;
+ lib.optionalString (v != null) (generators.mkKeyValueDefault {} "=" k v);
} cfg.settings);
need_CAP_NET_BIND_SERVICE = cfg.settings.identd_port != 0 && cfg.settings.identd_port < 1024;
in
diff --git a/nixos/modules/services/networking/cjdns.nix b/nixos/modules/services/networking/cjdns.nix
index 5a19475161fd..80085da92702 100644
--- a/nixos/modules/services/networking/cjdns.nix
+++ b/nixos/modules/services/networking/cjdns.nix
@@ -239,7 +239,7 @@ in
after = [ "network-online.target" ];
bindsTo = [ "network-online.target" ];
- preStart = if cfg.confFile != null then "" else ''
+ preStart = optionalString (cfg.confFile == null) ''
[ -e /etc/cjdns.keys ] && source /etc/cjdns.keys
if [ -z "$CJDNS_PRIVATE_KEY" ]; then
diff --git a/nixos/modules/services/networking/libreswan.nix b/nixos/modules/services/networking/libreswan.nix
index 785729d8f742..b8a3d6c8fdb5 100644
--- a/nixos/modules/services/networking/libreswan.nix
+++ b/nixos/modules/services/networking/libreswan.nix
@@ -14,8 +14,8 @@ let
nonchars = filter (x : !(elem x.value chars))
(imap0 (i: v: {ind = i; value = v;}) (stringToCharacters str));
in
- if length nonchars == 0 then ""
- else substring (head nonchars).ind (add 1 (sub (last nonchars).ind (head nonchars).ind)) str;
+ lib.optionalString (length nonchars != 0)
+ (substring (head nonchars).ind (add 1 (sub (last nonchars).ind (head nonchars).ind)) str);
indent = str: concatStrings (concatMap (s: [" " (trim [" " "\t"] s) "\n"]) (splitString "\n" str));
configText = indent (toString cfg.configSetup);
connectionText = concatStrings (mapAttrsToList (n: v:
diff --git a/nixos/modules/services/networking/murmur.nix b/nixos/modules/services/networking/murmur.nix
index ebade7aa8e40..37a1ff8b2d34 100644
--- a/nixos/modules/services/networking/murmur.nix
+++ b/nixos/modules/services/networking/murmur.nix
@@ -19,8 +19,8 @@ let
welcometext="${cfg.welcometext}"
port=${toString cfg.port}
- ${if cfg.hostName == "" then "" else "host="+cfg.hostName}
- ${if cfg.password == "" then "" else "serverpassword="+cfg.password}
+ ${optionalString (cfg.hostName != "") "host=${cfg.hostName}"}
+ ${optionalString (cfg.password != "") "serverpassword=${cfg.password}"}
bandwidth=${toString cfg.bandwidth}
users=${toString cfg.users}
@@ -32,17 +32,17 @@ let
bonjour=${boolToString cfg.bonjour}
sendversion=${boolToString cfg.sendVersion}
- ${if cfg.registerName == "" then "" else "registerName="+cfg.registerName}
- ${if cfg.registerPassword == "" then "" else "registerPassword="+cfg.registerPassword}
- ${if cfg.registerUrl == "" then "" else "registerUrl="+cfg.registerUrl}
- ${if cfg.registerHostname == "" then "" else "registerHostname="+cfg.registerHostname}
+ ${optionalString (cfg.registerName != "") "registerName=${cfg.registerName}"}
+ ${optionalString (cfg.registerPassword == "") "registerPassword=${cfg.registerPassword}"}
+ ${optionalString (cfg.registerUrl != "") "registerUrl=${cfg.registerUrl}"}
+ ${optionalString (cfg.registerHostname != "") "registerHostname=${cfg.registerHostname}"}
certrequired=${boolToString cfg.clientCertRequired}
- ${if cfg.sslCert == "" then "" else "sslCert="+cfg.sslCert}
- ${if cfg.sslKey == "" then "" else "sslKey="+cfg.sslKey}
- ${if cfg.sslCa == "" then "" else "sslCA="+cfg.sslCa}
+ ${optionalString (cfg.sslCert != "") "sslCert=${cfg.sslCert}"}
+ ${optionalString (cfg.sslKey != "") "sslKey=${cfg.sslKey}"}
+ ${optionalString (cfg.sslCa != "") "sslCA=${cfg.sslCa}"}
- ${lib.optionalString (cfg.dbus != null) "dbus=${cfg.dbus}"}
+ ${optionalString (cfg.dbus != null) "dbus=${cfg.dbus}"}
${cfg.extraConfig}
'';
diff --git a/nixos/modules/services/networking/nsd.nix b/nixos/modules/services/networking/nsd.nix
index 09f3bdc7ae07..6db728e7aa5a 100644
--- a/nixos/modules/services/networking/nsd.nix
+++ b/nixos/modules/services/networking/nsd.nix
@@ -137,8 +137,8 @@ let
'';
yesOrNo = b: if b then "yes" else "no";
- maybeString = prefix: x: if x == null then "" else ''${prefix} "${x}"'';
- maybeToString = prefix: x: if x == null then "" else ''${prefix} ${toString x}'';
+ maybeString = prefix: x: optionalString (x != null) ''${prefix} "${x}"'';
+ maybeToString = prefix: x: optionalString (x != null) ''${prefix} ${toString x}'';
forEach = pre: l: concatMapStrings (x: pre + x + "\n") l;
diff --git a/nixos/modules/services/networking/ssh/lshd.nix b/nixos/modules/services/networking/ssh/lshd.nix
index af64969c2fcd..129e42055514 100644
--- a/nixos/modules/services/networking/ssh/lshd.nix
+++ b/nixos/modules/services/networking/ssh/lshd.nix
@@ -165,9 +165,7 @@ in
${lsh}/sbin/lshd --daemonic \
--password-helper="${lsh}/sbin/lsh-pam-checkpw" \
-p ${toString portNumber} \
- ${if interfaces == [] then ""
- else (concatStrings (map (i: "--interface=\"${i}\"")
- interfaces))} \
+ ${optionalString (interfaces != []) (concatStrings (map (i: "--interface=\"${i}\"") interfaces))} \
-h "${hostKey}" \
${optionalString (!syslog) "--no-syslog" } \
${if passwordAuthentication then "--password" else "--no-password" } \
diff --git a/nixos/modules/services/scheduling/fcron.nix b/nixos/modules/services/scheduling/fcron.nix
index f1d2f462a755..47bd358f979d 100644
--- a/nixos/modules/services/scheduling/fcron.nix
+++ b/nixos/modules/services/scheduling/fcron.nix
@@ -6,7 +6,7 @@ let
cfg = config.services.fcron;
- queuelen = if cfg.queuelen == null then "" else "-q ${toString cfg.queuelen}";
+ queuelen = optionalString (cfg.queuelen != null) "-q ${toString cfg.queuelen}";
# Duplicate code, also found in cron.nix. Needs deduplication.
systemCronJobs =
diff --git a/nixos/modules/services/web-apps/invidious.nix b/nixos/modules/services/web-apps/invidious.nix
index e875be47fb91..8823da010014 100644
--- a/nixos/modules/services/web-apps/invidious.nix
+++ b/nixos/modules/services/web-apps/invidious.nix
@@ -62,7 +62,7 @@ let
port = cfg.database.port;
# Blank for unix sockets, see
# https://github.com/will/crystal-pg/blob/1548bb255210/src/pq/conninfo.cr#L100-L108
- host = if cfg.database.host == null then "" else cfg.database.host;
+ host = lib.optionalString (cfg.database.host != null) cfg.database.host;
# Not needed because peer authentication is enabled
password = lib.mkIf (cfg.database.host == null) "";
};
diff --git a/nixos/modules/services/web-apps/invoiceplane.nix b/nixos/modules/services/web-apps/invoiceplane.nix
index 8be1fd3055d0..f419b75cf70f 100644
--- a/nixos/modules/services/web-apps/invoiceplane.nix
+++ b/nixos/modules/services/web-apps/invoiceplane.nix
@@ -16,7 +16,7 @@ let
DB_HOSTNAME=${cfg.database.host}
DB_USERNAME=${cfg.database.user}
# NOTE: file_get_contents adds newline at the end of returned string
- DB_PASSWORD=${if cfg.database.passwordFile == null then "" else "trim(file_get_contents('${cfg.database.passwordFile}'), \"\\r\\n\")"}
+ DB_PASSWORD=${optionalString (cfg.database.passwordFile != null) "trim(file_get_contents('${cfg.database.passwordFile}'), \"\\r\\n\")"}
DB_DATABASE=${cfg.database.name}
DB_PORT=${toString cfg.database.port}
SESS_EXPIRATION=864000
diff --git a/nixos/modules/services/web-apps/peertube.nix b/nixos/modules/services/web-apps/peertube.nix
index 4ef2d7dce532..8a1fc3c567cc 100644
--- a/nixos/modules/services/web-apps/peertube.nix
+++ b/nixos/modules/services/web-apps/peertube.nix
@@ -350,7 +350,7 @@ in {
};
redis = {
hostname = "${toString cfg.redis.host}";
- port = (if cfg.redis.port == null then "" else cfg.redis.port);
+ port = (lib.optionalString (cfg.redis.port != null) cfg.redis.port);
};
storage = {
tmp = lib.mkDefault "/var/lib/peertube/storage/tmp/";
diff --git a/nixos/modules/services/web-servers/lighttpd/cgit.nix b/nixos/modules/services/web-servers/lighttpd/cgit.nix
index 5042fbf1f8f2..e9f42c41183b 100644
--- a/nixos/modules/services/web-servers/lighttpd/cgit.nix
+++ b/nixos/modules/services/web-servers/lighttpd/cgit.nix
@@ -4,7 +4,7 @@ with lib;
let
cfg = config.services.lighttpd.cgit;
- pathPrefix = if stringLength cfg.subdir == 0 then "" else "/" + cfg.subdir;
+ pathPrefix = optionalString (stringLength cfg.subdir != 0) ("/" + cfg.subdir);
configFile = pkgs.writeText "cgitrc"
''
# default paths to static assets
diff --git a/nixos/modules/services/x11/desktop-managers/phosh.nix b/nixos/modules/services/x11/desktop-managers/phosh.nix
index 3cfa6e044b73..e4cd9fd99e40 100644
--- a/nixos/modules/services/x11/desktop-managers/phosh.nix
+++ b/nixos/modules/services/x11/desktop-managers/phosh.nix
@@ -100,7 +100,7 @@ let
};
};
- optionalKV = k: v: if v == null then "" else "${k} = ${builtins.toString v}";
+ optionalKV = k: v: optionalString (v != null) "${k} = ${builtins.toString v}";
renderPhocOutput = name: output: let
modelines = if builtins.isList output.modeline
diff --git a/nixos/modules/system/boot/kernel_config.nix b/nixos/modules/system/boot/kernel_config.nix
index 31e9ec626ca6..e618070f0dc3 100644
--- a/nixos/modules/system/boot/kernel_config.nix
+++ b/nixos/modules/system/boot/kernel_config.nix
@@ -70,11 +70,10 @@ let
let
val = if item.freeform != null then item.freeform else item.tristate;
in
- if val == null
- then ""
- else if (item.optional)
+ optionalString (val != null)
+ (if (item.optional)
then "${key}? ${mkValue val}\n"
- else "${key} ${mkValue val}\n";
+ else "${key} ${mkValue val}\n");
mkConf = cfg: concatStrings (mapAttrsToList mkConfigLine cfg);
in mkConf exprs;
diff --git a/nixos/modules/system/boot/loader/grub/grub.nix b/nixos/modules/system/boot/loader/grub/grub.nix
index 9f80b40d116c..a10dd3d0ca78 100644
--- a/nixos/modules/system/boot/loader/grub/grub.nix
+++ b/nixos/modules/system/boot/loader/grub/grub.nix
@@ -65,8 +65,8 @@ let
[ coreutils gnused gnugrep findutils diffutils btrfs-progs util-linux mdadm ]
++ optional cfg.efiSupport efibootmgr
++ optionals cfg.useOSProber [ busybox os-prober ]);
- font = if cfg.font == null then ""
- else (if lib.last (lib.splitString "." cfg.font) == "pf2"
+ font = lib.optionalString (cfg.font != null) (
+ if lib.last (lib.splitString "." cfg.font) == "pf2"
then cfg.font
else "${convertedFont}");
});
diff --git a/nixos/modules/system/boot/systemd/user.nix b/nixos/modules/system/boot/systemd/user.nix
index 92e1b087392d..1b6398d2f929 100644
--- a/nixos/modules/system/boot/systemd/user.nix
+++ b/nixos/modules/system/boot/systemd/user.nix
@@ -42,7 +42,7 @@ let
writeTmpfiles = { rules, user ? null }:
let
- suffix = if user == null then "" else "-${user}";
+ suffix = optionalString (user != null) "-${user}";
in
pkgs.writeTextFile {
name = "nixos-user-tmpfiles.d${suffix}";
diff --git a/pkgs/applications/editors/texmacs/darwin.nix b/pkgs/applications/editors/texmacs/darwin.nix
index ff090dd3259a..8c74d8c5c8f2 100644
--- a/pkgs/applications/editors/texmacs/darwin.nix
+++ b/pkgs/applications/editors/texmacs/darwin.nix
@@ -47,10 +47,10 @@ stdenv.mkDerivation {
postInstall = "wrapProgram $out/Applications/TeXmacs-${version}/Contents/MacOS/TeXmacs --suffix PATH : " +
"${ghostscript}/bin:" +
- (if aspell == null then "" else "${aspell}/bin:") +
- (if tex == null then "" else "${tex}/bin:") +
- (if netpbm == null then "" else "${lib.getBin netpbm}/bin:") +
- (if imagemagick == null then "" else "${imagemagick}/bin:");
+ (lib.optionalString (aspell != null) "${aspell}/bin:") +
+ (lib.optionalString (tex != null) "${tex}/bin:") +
+ (lib.optionalString (netpbm != null) "${lib.getBin netpbm}/bin:") +
+ (lib.optionalString (imagemagick != null) "${imagemagick}/bin:");
enableParallelBuilding = true;
diff --git a/pkgs/applications/editors/vscode/vscodium.nix b/pkgs/applications/editors/vscode/vscodium.nix
index 3e66c7e6abd0..b434279621d1 100644
--- a/pkgs/applications/editors/vscode/vscodium.nix
+++ b/pkgs/applications/editors/vscode/vscodium.nix
@@ -22,7 +22,7 @@ let
armv7l-linux = "0m1v24gg2dy79hgrz37gysgrazg8vkr1gkp52j6m6y76vi0l8249";
}.${system} or throwSystem;
- sourceRoot = if stdenv.isDarwin then "" else ".";
+ sourceRoot = lib.optionalString (!stdenv.isDarwin) ".";
in
callPackage ./generic.nix rec {
inherit sourceRoot commandLineArgs useVSCodeRipgrep;
diff --git a/pkgs/applications/networking/browsers/chromium/default.nix b/pkgs/applications/networking/browsers/chromium/default.nix
index 77f4def41f33..a5e6855e9637 100644
--- a/pkgs/applications/networking/browsers/chromium/default.nix
+++ b/pkgs/applications/networking/browsers/chromium/default.nix
@@ -134,9 +134,7 @@ let
};
};
- suffix = if (channel == "stable" || channel == "ungoogled-chromium")
- then ""
- else "-" + channel;
+ suffix = lib.optionalString (channel != "stable" && channel != "ungoogled-chromium") ("-" + channel);
sandboxExecutableName = chromium.browser.passthru.sandboxExecutableName;
diff --git a/pkgs/applications/networking/browsers/microsoft-edge/browser.nix b/pkgs/applications/networking/browsers/microsoft-edge/browser.nix
index 2af28bb8dd06..7f72a42ffe0d 100644
--- a/pkgs/applications/networking/browsers/microsoft-edge/browser.nix
+++ b/pkgs/applications/networking/browsers/microsoft-edge/browser.nix
@@ -46,13 +46,9 @@ let
then baseName
else baseName + "-" + channel;
- iconSuffix = if channel == "stable"
- then ""
- else "_${channel}";
+ iconSuffix = lib.optionalString (channel != "stable") "_${channel}";
- desktopSuffix = if channel == "stable"
- then ""
- else "-${channel}";
+ desktopSuffix = lib.optionalString (channel != "stable") "-${channel}";
in
stdenv.mkDerivation rec {
diff --git a/pkgs/applications/office/libreoffice/default.nix b/pkgs/applications/office/libreoffice/default.nix
index 25e8f18998e2..518167cb33d1 100644
--- a/