git.iko.soy/typeable/nixpkgs
on master help sign in
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.

commitcb682317b008799e3bf647484c6a48d078bc0230 authorAntoine Eiche <lewo@abesis.fr> dateSun 7 Jun 2020, 20:31 (6 years ago) parent1059cda
1 file changed+1−1
nixos/modules/services/web-apps/nextcloud.nix+1−1
nixos/modules/services/web-apps/nextcloud.nix+1−1
@@ -34,7 +34,7 @@ let
3434 cd ${cfg.package}
3535 sudo=exec
3636 if [[ "$USER" != nextcloud ]]; then
37− sudo='exec /run/wrappers/bin/sudo -u nextcloud --preserve-env=NEXTCLOUD_CONFIG_DIR'
37+ sudo='exec /run/wrappers/bin/sudo -u nextcloud --preserve-env=NEXTCLOUD_CONFIG_DIR --preserve-env=OC_PASS'
3838 fi
3939 export NEXTCLOUD_CONFIG_DIR="${cfg.home}/config"
4040 $sudo \