diff --git a/clanModules/postgresql/default.nix b/clanModules/postgresql/default.nix index 215b7fec4..185929881 100644 --- a/clanModules/postgresql/default.nix +++ b/clanModules/postgresql/default.nix @@ -159,8 +159,12 @@ in if [[ -e "${current}" ]]; then ( - systemctl stop ${lib.concatStringsSep " " db.restore.stopOnRestore} - trap "systemctl start ${lib.concatStringsSep " " db.restore.stopOnRestore}" EXIT + ${ + lib.optionalString (db.restore.stopOnRestore != [ ]) '' + systemctl stop ${builtins.toString db.restore.stopOnRestore} + trap "systemctl start ${builtins.toString db.restore.stopOnRestore}" EXIT + '' + } mkdir -p "${folder}" runuser -u postgres -- dropdb "${db.name}"