0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-13 21:50:33 +03:00

Merge pull request #239624 from Stunkymonkey/use-optionalString-then

treewide: use optionalString instead of 'then ""'
This commit is contained in:
Felix Bühler 2023-07-22 13:02:47 +02:00 committed by GitHub
commit 0a2745684e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
53 changed files with 101 additions and 116 deletions

View file

@ -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}