Skip to content

Commit

Permalink
use optionalString
Browse files Browse the repository at this point in the history
  • Loading branch information
shivaraj-bh committed Feb 15, 2024
1 parent 3b04710 commit ce6456e
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions nix/mysql.nix
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,8 @@ in
exec ${config.package}/bin/mysqld ${mysqldOptions}
'';

runInitialScript =
if config.initialScript != null then
''
echo ${lib.escapeShellArg config.initialScript} | MYSQL_PWD="" ${config.package}/bin/mysql -u root -N
''
else "";
runInitialScript = lib.optionalString (config.initialScript != null) ''echo ${lib.escapeShellArg config.initialScript} | MYSQL_PWD="" ${config.package}/bin/mysql -u root -N
'';

configureScript = pkgs.writeShellScriptBin "configure-mysql" ''
PATH="${lib.makeBinPath [config.package pkgs.coreutils]}:$PATH"
Expand Down

0 comments on commit ce6456e

Please sign in to comment.