diff options
Diffstat (limited to 'nixos/modules/services/web-apps/nextcloud.nix')
-rw-r--r-- | nixos/modules/services/web-apps/nextcloud.nix | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/nixos/modules/services/web-apps/nextcloud.nix b/nixos/modules/services/web-apps/nextcloud.nix index d0e45e1c12a..887478d0788 100644 --- a/nixos/modules/services/web-apps/nextcloud.nix +++ b/nixos/modules/services/web-apps/nextcloud.nix @@ -257,6 +257,23 @@ in { ''; }; }; + autoUpdateApps = { + enable = mkOption { + type = types.bool; + default = false; + description = '' + Run a auto update of all installed apps from the nextcloud repository. + ''; + }; + startAt = mkOption { + type = with types; either str (listOf str); + default = "05:00:00"; + example = "Sun 14:00:00"; + description = '' + When to run the update. See `systemd.services.<name>.startAt`. + ''; + }; + }; }; config = mkIf cfg.enable (mkMerge [ @@ -362,6 +379,11 @@ in { serviceConfig.User = "nextcloud"; serviceConfig.ExecStart = "${phpPackage}/bin/php -f ${pkgs.nextcloud}/cron.php"; }; + "nextcloud-update-plugins" = mkIf cfg.autoUpdateApps.enable { + serviceConfig.Type = "oneshot"; + serviceConfig.ExecStart = "${occ}/bin/nextcloud-occ app:update --all"; + startAt = cfg.autoUpdateApps.startAt; + }; }; services.phpfpm = { |