From cb682317b008799e3bf647484c6a48d078bc0230 Mon Sep 17 00:00:00 2001 From: Antoine Eiche Date: Sun, 7 Jun 2020 20:31:45 +0200 Subject: [PATCH] nixos/nextcloud: preserve OC_PASS env variable in the occ wrapper The OC_PASS environment variable can be used to create a user with `occ user:add --password-from-env`. It is currently not possible to use the `nextcloud-occ` to "non-interactively" create a user since this variable is ignored by sudo. --- nixos/modules/services/web-apps/nextcloud.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/services/web-apps/nextcloud.nix b/nixos/modules/services/web-apps/nextcloud.nix index f826096bf608..5b9065dec3c5 100644 --- a/nixos/modules/services/web-apps/nextcloud.nix +++ b/nixos/modules/services/web-apps/nextcloud.nix @@ -34,7 +34,7 @@ let cd ${cfg.package} sudo=exec if [[ "$USER" != nextcloud ]]; then - sudo='exec /run/wrappers/bin/sudo -u nextcloud --preserve-env=NEXTCLOUD_CONFIG_DIR' + sudo='exec /run/wrappers/bin/sudo -u nextcloud --preserve-env=NEXTCLOUD_CONFIG_DIR --preserve-env=OC_PASS' fi export NEXTCLOUD_CONFIG_DIR="${cfg.home}/config" $sudo \