nextcloud: disableMaintenanceModeAtStart option
This commit is contained in:
@@ -93,6 +93,16 @@ in
|
||||
weight = 4;
|
||||
};
|
||||
};
|
||||
disableMaintenanceModeAtStart = (lib.mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = "Disable maintenance mode at Nextcloud service startup";
|
||||
}) // {
|
||||
meta = {
|
||||
type = "bool";
|
||||
weight = 5;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# config = lib.mkIf sp.modules.nextcloud.enable
|
||||
@@ -222,8 +232,16 @@ in
|
||||
# the following part is active only when "auth" module is enabled
|
||||
(lib.mkIf is-auth-enabled {
|
||||
systemd.services.nextcloud-setup = {
|
||||
serviceConfig = {
|
||||
Restart = "on-failure";
|
||||
RestartSec = "60";
|
||||
};
|
||||
path = [ pkgs.jq ];
|
||||
script = ''
|
||||
script = lib.mkMerge [
|
||||
(lib.strings.optionalString cfg.disableMaintenanceModeAtStart (
|
||||
lib.mkBefore "${occ} maintenance:mode --no-interaction --off"
|
||||
))
|
||||
''
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
${lib.strings.optionalString cfg.debug "set -o xtrace"}
|
||||
@@ -319,12 +337,14 @@ in
|
||||
--group-provisioning=1 \
|
||||
-vvv
|
||||
|
||||
'' + lib.optionalString deleteNextcloudAdmin ''
|
||||
''
|
||||
(lib.optionalString deleteNextcloudAdmin ''
|
||||
if [[ ! -f /var/lib/nextcloud/.admin-user-deleted ]]; then
|
||||
${occ} user:delete admin
|
||||
touch /var/lib/nextcloud/.admin-user-deleted
|
||||
fi
|
||||
'';
|
||||
'')
|
||||
];
|
||||
};
|
||||
selfprivacy.auth.clients."${oauthClientID}" = {
|
||||
inherit adminsGroup usersGroup;
|
||||
|
Reference in New Issue
Block a user