From 51c3144112b4b5d3817cc35dde0964abc1a3cf7f Mon Sep 17 00:00:00 2001 From: Lucie Date: Sun, 14 Sep 2025 22:43:57 +0200 Subject: [PATCH] nixos/mongodb: fix initialScript when dbpath exists and is empty --- nixos/modules/services/databases/mongodb.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nixos/modules/services/databases/mongodb.nix b/nixos/modules/services/databases/mongodb.nix index 1eba6fdc60af..c9270d24d479 100644 --- a/nixos/modules/services/databases/mongodb.nix +++ b/nixos/modules/services/databases/mongodb.nix @@ -164,6 +164,8 @@ in rm ${cfg.dbpath}/mongod.lock || true if ! test -e ${cfg.dbpath}; then install -d -m0700 -o ${cfg.user} ${cfg.dbpath} + fi + if ! test -e ${cfg.dbpath}/storage.bson; then # See postStart! touch ${cfg.dbpath}/.first_startup fi