commit
41c0f49681
@ -83,7 +83,16 @@
|
|||||||
|
|
||||||
<itemizedlist>
|
<itemizedlist>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para />
|
<para>
|
||||||
|
The default-version of <literal>nextcloud</literal> is <package>nextcloud20</package>.
|
||||||
|
Please note that it's <emphasis>not</emphasis> possible to upgrade <literal>nextcloud</literal>
|
||||||
|
across multiple major versions! This means that it's e.g. not possible to upgrade
|
||||||
|
from <package>nextcloud18</package> to <package>nextcloud20</package> in a single deploy.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
The package can be manually upgraded by setting <xref linkend="opt-services.nextcloud.package" />
|
||||||
|
to <package>nextcloud20</package>.
|
||||||
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</itemizedlist>
|
</itemizedlist>
|
||||||
</section>
|
</section>
|
||||||
|
@ -85,7 +85,7 @@ in {
|
|||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
description = "Which package to use for the Nextcloud instance.";
|
description = "Which package to use for the Nextcloud instance.";
|
||||||
relatedPackages = [ "nextcloud18" "nextcloud19" ];
|
relatedPackages = [ "nextcloud18" "nextcloud19" "nextcloud20" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
maxUploadSize = mkOption {
|
maxUploadSize = mkOption {
|
||||||
@ -330,37 +330,28 @@ in {
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
warnings = []
|
warnings = let
|
||||||
++ (optional (cfg.poolConfig != null) ''
|
latest = 20;
|
||||||
|
upgradeWarning = major: nixos:
|
||||||
|
''
|
||||||
|
A legacy Nextcloud install (from before NixOS ${nixos}) may be installed.
|
||||||
|
|
||||||
|
After nextcloud${toString major} is installed successfully, you can safely upgrade
|
||||||
|
to ${toString (major + 1)}. The latest version available is nextcloud${toString latest}.
|
||||||
|
|
||||||
|
Please note that Nextcloud doesn't support upgrades across multiple major versions
|
||||||
|
(i.e. an upgrade from 16 is possible to 17, but not 16 to 18).
|
||||||
|
|
||||||
|
The package can be upgraded by explicitly declaring the service-option
|
||||||
|
`services.nextcloud.package`.
|
||||||
|
'';
|
||||||
|
in (optional (cfg.poolConfig != null) ''
|
||||||
Using config.services.nextcloud.poolConfig is deprecated and will become unsupported in a future release.
|
Using config.services.nextcloud.poolConfig is deprecated and will become unsupported in a future release.
|
||||||
Please migrate your configuration to config.services.nextcloud.poolSettings.
|
Please migrate your configuration to config.services.nextcloud.poolSettings.
|
||||||
'')
|
'')
|
||||||
++ (optional (versionOlder cfg.package.version "18") ''
|
++ (optional (versionOlder cfg.package.version "18") (upgradeWarning 17 "20.03"))
|
||||||
A legacy Nextcloud install (from before NixOS 20.03) may be installed.
|
++ (optional (versionOlder cfg.package.version "19") (upgradeWarning 18 "20.09"))
|
||||||
|
++ (optional (versionOlder cfg.package.version "20") (upgradeWarning 19 "21.03"));
|
||||||
You're currently deploying an older version of Nextcloud. This may be needed
|
|
||||||
since Nextcloud doesn't allow major version upgrades that skip multiple
|
|
||||||
versions (i.e. an upgrade from 16 is possible to 17, but not 16 to 18).
|
|
||||||
|
|
||||||
It is assumed that Nextcloud will be upgraded from version 16 to 17.
|
|
||||||
|
|
||||||
* If this is a fresh install, there will be no upgrade to do now.
|
|
||||||
|
|
||||||
* If this server already had Nextcloud installed, first deploy this to your
|
|
||||||
server, and wait until the upgrade to 17 is finished.
|
|
||||||
|
|
||||||
Then, set `services.nextcloud.package` to `pkgs.nextcloud18` to upgrade to
|
|
||||||
Nextcloud version 18. Please note that Nextcloud 19 is already out and it's
|
|
||||||
recommended to upgrade to nextcloud19 after that.
|
|
||||||
'')
|
|
||||||
++ (optional (versionOlder cfg.package.version "19") ''
|
|
||||||
A legacy Nextcloud install (from before NixOS 20.09) may be installed.
|
|
||||||
|
|
||||||
If/After nextcloud18 is installed successfully, you can safely upgrade to
|
|
||||||
nextcloud19. If not, please upgrade to nextcloud18 first since Nextcloud doesn't
|
|
||||||
support upgrades that skip multiple versions (i.e. an upgrade from 17 to 19 isn't
|
|
||||||
possible, but an upgrade from 18 to 19).
|
|
||||||
'');
|
|
||||||
|
|
||||||
services.nextcloud.package = with pkgs;
|
services.nextcloud.package = with pkgs;
|
||||||
mkDefault (
|
mkDefault (
|
||||||
@ -372,7 +363,8 @@ in {
|
|||||||
''
|
''
|
||||||
else if versionOlder stateVersion "20.03" then nextcloud17
|
else if versionOlder stateVersion "20.03" then nextcloud17
|
||||||
else if versionOlder stateVersion "20.09" then nextcloud18
|
else if versionOlder stateVersion "20.09" then nextcloud18
|
||||||
else nextcloud19
|
else if versionOlder stateVersion "21.03" then nextcloud19
|
||||||
|
else nextcloud20
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -435,7 +427,7 @@ in {
|
|||||||
then ''"$(<"${toString c.dbpassFile}")"''
|
then ''"$(<"${toString c.dbpassFile}")"''
|
||||||
else if c.dbpass != null
|
else if c.dbpass != null
|
||||||
then ''"${toString c.dbpass}"''
|
then ''"${toString c.dbpass}"''
|
||||||
else null;
|
else ''""'';
|
||||||
adminpass = if c.adminpassFile != null
|
adminpass = if c.adminpassFile != null
|
||||||
then ''"$(<"${toString c.adminpassFile}")"''
|
then ''"$(<"${toString c.adminpassFile}")"''
|
||||||
else ''"${toString c.adminpass}"'';
|
else ''"${toString c.adminpass}"'';
|
||||||
@ -449,8 +441,7 @@ in {
|
|||||||
${if c.dbhost != null then "--database-host" else null} = ''"${c.dbhost}"'';
|
${if c.dbhost != null then "--database-host" else null} = ''"${c.dbhost}"'';
|
||||||
${if c.dbport != null then "--database-port" else null} = ''"${toString c.dbport}"'';
|
${if c.dbport != null then "--database-port" else null} = ''"${toString c.dbport}"'';
|
||||||
${if c.dbuser != null then "--database-user" else null} = ''"${c.dbuser}"'';
|
${if c.dbuser != null then "--database-user" else null} = ''"${c.dbuser}"'';
|
||||||
${if (any (x: x != null) [c.dbpass c.dbpassFile])
|
"--database-pass" = dbpass;
|
||||||
then "--database-pass" else null} = dbpass;
|
|
||||||
${if c.dbtableprefix != null
|
${if c.dbtableprefix != null
|
||||||
then "--database-table-prefix" else null} = ''"${toString c.dbtableprefix}"'';
|
then "--database-table-prefix" else null} = ''"${toString c.dbtableprefix}"'';
|
||||||
"--admin-user" = ''"${c.adminuser}"'';
|
"--admin-user" = ''"${c.adminuser}"'';
|
||||||
@ -543,9 +534,9 @@ in {
|
|||||||
|
|
||||||
services.nginx.enable = mkDefault true;
|
services.nginx.enable = mkDefault true;
|
||||||
|
|
||||||
# FIXME(ma27) make sure that the config works fine with Nextcloud 19
|
services.nginx.virtualHosts.${cfg.hostName} = let
|
||||||
# *and* Nextcloud 20 as soon as it gets released.
|
major = toInt (versions.major cfg.package.version);
|
||||||
services.nginx.virtualHosts.${cfg.hostName} = {
|
in {
|
||||||
root = cfg.package;
|
root = cfg.package;
|
||||||
locations = {
|
locations = {
|
||||||
"= /robots.txt" = {
|
"= /robots.txt" = {
|
||||||
@ -558,7 +549,9 @@ in {
|
|||||||
};
|
};
|
||||||
"/" = {
|
"/" = {
|
||||||
priority = 900;
|
priority = 900;
|
||||||
extraConfig = "rewrite ^ /index.php;";
|
extraConfig = if major < 20
|
||||||
|
then "rewrite ^ /index.php;"
|
||||||
|
else "try_files $uri $uri/ /index.php$request_uri;";
|
||||||
};
|
};
|
||||||
"~ ^/store-apps" = {
|
"~ ^/store-apps" = {
|
||||||
priority = 201;
|
priority = 201;
|
||||||
@ -582,7 +575,7 @@ in {
|
|||||||
"~ ^/(?:\\.|autotest|occ|issue|indie|db_|console)".extraConfig = ''
|
"~ ^/(?:\\.|autotest|occ|issue|indie|db_|console)".extraConfig = ''
|
||||||
return 404;
|
return 404;
|
||||||
'';
|
'';
|
||||||
"~ ^\\/(?:index|remote|public|cron|core\\/ajax\\/update|status|ocs\\/v[12]|updater\\/.+|oc[ms]-provider\\/.+|.+\\/richdocumentscode\\/proxy)\\.php(?:$|\\/)" = {
|
${if major < 20 then "~ ^\\/(?:index|remote|public|cron|core\\/ajax\\/update|status|ocs\\/v[12]|updater\\/.+|oc[ms]-provider\\/.+|.+\\/richdocumentscode\\/proxy)\\.php(?:$|\\/)" else "~ \\.php(?:$|/)"} = {
|
||||||
priority = 500;
|
priority = 500;
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
include ${config.services.nginx.package}/conf/fastcgi.conf;
|
include ${config.services.nginx.package}/conf/fastcgi.conf;
|
||||||
|
@ -49,4 +49,9 @@ in {
|
|||||||
version = "19.0.3";
|
version = "19.0.3";
|
||||||
sha256 = "0sc9cnsdh8kj60h7i3knh40ngdz1w1wmdqw2v2axfkmax22kjl7w";
|
sha256 = "0sc9cnsdh8kj60h7i3knh40ngdz1w1wmdqw2v2axfkmax22kjl7w";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
nextcloud20 = generic {
|
||||||
|
version = "20.0.0";
|
||||||
|
sha256 = "1n2cv1i56g6qpzkbl5xaf420zzr4y7isg0lskmr7ymk83way0wx2";
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
@ -5715,7 +5715,7 @@ in
|
|||||||
grocy = callPackage ../servers/grocy { };
|
grocy = callPackage ../servers/grocy { };
|
||||||
|
|
||||||
inherit (callPackage ../servers/nextcloud {})
|
inherit (callPackage ../servers/nextcloud {})
|
||||||
nextcloud17 nextcloud18 nextcloud19;
|
nextcloud17 nextcloud18 nextcloud19 nextcloud20;
|
||||||
|
|
||||||
nextcloud-client = libsForQt514.callPackage ../applications/networking/nextcloud-client { };
|
nextcloud-client = libsForQt514.callPackage ../applications/networking/nextcloud-client { };
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user