From fe44ba6fd812039b485e3f6f9b7c8bcdaf5ff98d Mon Sep 17 00:00:00 2001 From: Alexander Tomokhov Date: Wed, 27 Dec 2023 15:05:23 +0400 Subject: [PATCH] fix nextcloud: fail if secrets are missing --- sp-modules/nextcloud/module.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sp-modules/nextcloud/module.nix b/sp-modules/nextcloud/module.nix index 913e752..845c435 100644 --- a/sp-modules/nextcloud/module.nix +++ b/sp-modules/nextcloud/module.nix @@ -35,12 +35,15 @@ serviceConfig.Type = "oneshot"; path = with pkgs; [ coreutils jq ]; script = '' + databasePassword=$(jq -re '.modules.nextcloud.databasePassword' ${secrets-filepath}) + adminPassword=$(jq -re '.modules.nextcloud.adminPassword' ${secrets-filepath}) + install -C -m 0440 -o nextcloud -g nextcloud -DT \ - <(jq -re '.modules.nextcloud.databasePassword' ${secrets-filepath}) \ + <(printf "%s\n" "$databasePassword") \ ${db-pass-filepath} install -C -m 0440 -o nextcloud -g nextcloud -DT \ - <(jq -re '.modules.nextcloud.adminPassword' ${secrets-filepath}) \ + <(printf "%s\n" "$adminPassword") \ ${admin-pass-filepath} ''; };