1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-09-11 15:08:33 +01:00

nixos/nextcloud: Add services.nextcloud.autoUpdateApps (#61717)

nixos/nextcloud: Add services.nextcloud.autoUpdateApps
This commit is contained in:
Florian Klink 2019-05-21 14:20:07 +02:00 committed by GitHub
commit 36dfdccb38
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 32 additions and 0 deletions

View file

@ -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 = {

View file

@ -111,5 +111,11 @@
<link xlink:href="https://github.com/NixOS/nixpkgs/issues/49783">#49783</link>,
for now it's unfortunately necessary to manually work around these issues.
</para>
<para>
Right now app installation and configuration is done imperatively in the nextcloud web ui or via the <literal>nextcloud-occ</literal> command line utility.
You can activate auto updates for your apps via
<literal><link linkend="opt-services.nextcloud.autoUpdateApps.enable">services.nextcloud.autoUpdateApps</link></literal>.
</para>
</section>
</chapter>

View file

@ -22,6 +22,10 @@ in {
# Don't inherit adminuser since "root" is supposed to be the default
inherit adminpass;
};
autoUpdateApps = {
enable = true;
startAt = "20:00";
};
};
};
};