nixos/nextcloud: Rename extraOptions to settings
This commit is contained in:
parent
05f11d5cf8
commit
e1c0d281b2
6 changed files with 28 additions and 27 deletions
|
@ -206,15 +206,15 @@ The pre-existing [services.ankisyncd](#opt-services.ankisyncd.enable) has been m
|
|||
|
||||
- [Lilypond](https://lilypond.org/index.html) and [Denemo](https://www.denemo.org) are now compiled with Guile 3.0.
|
||||
|
||||
- The following options of the Nextcloud module were moved into [`services.nextcloud.extraOptions`](#opt-services.nextcloud.extraOptions) and renamed to match the name from Nextcloud's `config.php`:
|
||||
- `logLevel` -> [`loglevel`](#opt-services.nextcloud.extraOptions.loglevel),
|
||||
- `logType` -> [`log_type`](#opt-services.nextcloud.extraOptions.log_type),
|
||||
- `defaultPhoneRegion` -> [`default_phone_region`](#opt-services.nextcloud.extraOptions.default_phone_region),
|
||||
- `overwriteProtocol` -> [`overwriteprotocol`](#opt-services.nextcloud.extraOptions.overwriteprotocol),
|
||||
- `skeletonDirectory` -> [`skeletondirectory`](#opt-services.nextcloud.extraOptions.skeletondirectory),
|
||||
- `globalProfiles` -> [`profile.enabled`](#opt-services.nextcloud.extraOptions._profile.enabled_),
|
||||
- `extraTrustedDomains` -> [`trusted_domains`](#opt-services.nextcloud.extraOptions.trusted_domains) and
|
||||
- `trustedProxies` -> [`trusted_proxies`](#opt-services.nextcloud.extraOptions.trusted_proxies).
|
||||
- The following options of the Nextcloud module were moved into [`services.nextcloud.settings`](#opt-services.nextcloud.settings) and renamed to match the name from Nextcloud's `config.php`:
|
||||
- `logLevel` -> [`loglevel`](#opt-services.nextcloud.settings.loglevel),
|
||||
- `logType` -> [`log_type`](#opt-services.nextcloud.settings.log_type),
|
||||
- `defaultPhoneRegion` -> [`default_phone_region`](#opt-services.nextcloud.settings.default_phone_region),
|
||||
- `overwriteProtocol` -> [`overwriteprotocol`](#opt-services.nextcloud.settings.overwriteprotocol),
|
||||
- `skeletonDirectory` -> [`skeletondirectory`](#opt-services.nextcloud.settings.skeletondirectory),
|
||||
- `globalProfiles` -> [`profile.enabled`](#opt-services.nextcloud.settings._profile.enabled_),
|
||||
- `extraTrustedDomains` -> [`trusted_domains`](#opt-services.nextcloud.settings.trusted_domains) and
|
||||
- `trustedProxies` -> [`trusted_proxies`](#opt-services.nextcloud.settings.trusted_proxies).
|
||||
|
||||
- The option [`services.nextcloud.config.dbport`] of the Nextcloud module was removed to match upstream.
|
||||
The port can be specified in [`services.nextcloud.config.dbhost`](#opt-services.nextcloud.config.dbhost).
|
||||
|
|
|
@ -116,7 +116,7 @@ in
|
|||
}
|
||||
|
||||
(lib.mkIf cfg.bendDomainToLocalhost {
|
||||
nextcloud.extraOptions.trusted_proxies = [ "127.0.0.1" "::1" ];
|
||||
nextcloud.settings.trusted_proxies = [ "127.0.0.1" "::1" ];
|
||||
})
|
||||
];
|
||||
};
|
||||
|
|
|
@ -51,7 +51,7 @@ to ensure that changes can be applied by changing the module's options.
|
|||
In case the application serves multiple domains (those are checked with
|
||||
[`$_SERVER['HTTP_HOST']`](https://www.php.net/manual/en/reserved.variables.server.php))
|
||||
it's needed to add them to
|
||||
[`services.nextcloud.extraOptions.trusted_domains`](#opt-services.nextcloud.extraOptions.trusted_domains).
|
||||
[`services.nextcloud.settings.trusted_domains`](#opt-services.nextcloud.settings.trusted_domains).
|
||||
|
||||
Auto updates for Nextcloud apps can be enabled using
|
||||
[`services.nextcloud.autoUpdateApps`](#opt-services.nextcloud.autoUpdateApps.enable).
|
||||
|
|
|
@ -183,8 +183,8 @@ let
|
|||
];
|
||||
|
||||
$CONFIG = array_replace_recursive($CONFIG, nix_decode_json_file(
|
||||
"${jsonFormat.generate "nextcloud-extraOptions.json" cfg.extraOptions}",
|
||||
"impossible: this should never happen (decoding generated extraOptions file %s failed)"
|
||||
"${jsonFormat.generate "nextcloud-settings.json" cfg.settings}",
|
||||
"impossible: this should never happen (decoding generated settings file %s failed)"
|
||||
));
|
||||
|
||||
${optionalString (cfg.secretFile != null) ''
|
||||
|
@ -205,21 +205,22 @@ in {
|
|||
Add port to services.nextcloud.config.dbhost instead.
|
||||
'')
|
||||
(mkRenamedOptionModule
|
||||
[ "services" "nextcloud" "logLevel" ] [ "services" "nextcloud" "extraOptions" "loglevel" ])
|
||||
[ "services" "nextcloud" "logLevel" ] [ "services" "nextcloud" "settings" "loglevel" ])
|
||||
(mkRenamedOptionModule
|
||||
[ "services" "nextcloud" "logType" ] [ "services" "nextcloud" "extraOptions" "log_type" ])
|
||||
[ "services" "nextcloud" "logType" ] [ "services" "nextcloud" "settings" "log_type" ])
|
||||
(mkRenamedOptionModule
|
||||
[ "services" "nextcloud" "config" "defaultPhoneRegion" ] [ "services" "nextcloud" "extraOptions" "default_phone_region" ])
|
||||
[ "services" "nextcloud" "config" "defaultPhoneRegion" ] [ "services" "nextcloud" "settings" "default_phone_region" ])
|
||||
(mkRenamedOptionModule
|
||||
[ "services" "nextcloud" "config" "overwriteProtocol" ] [ "services" "nextcloud" "extraOptions" "overwriteprotocol" ])
|
||||
[ "services" "nextcloud" "config" "overwriteProtocol" ] [ "services" "nextcloud" "settings" "overwriteprotocol" ])
|
||||
(mkRenamedOptionModule
|
||||
[ "services" "nextcloud" "skeletonDirectory" ] [ "services" "nextcloud" "extraOptions" "skeletondirectory" ])
|
||||
[ "services" "nextcloud" "skeletonDirectory" ] [ "services" "nextcloud" "settings" "skeletondirectory" ])
|
||||
(mkRenamedOptionModule
|
||||
[ "services" "nextcloud" "globalProfiles" ] [ "services" "nextcloud" "extraOptions" "profile.enabled" ])
|
||||
[ "services" "nextcloud" "globalProfiles" ] [ "services" "nextcloud" "settings" "profile.enabled" ])
|
||||
(mkRenamedOptionModule
|
||||
[ "services" "nextcloud" "config" "extraTrustedDomains" ] [ "services" "nextcloud" "extraOptions" "trusted_domains" ])
|
||||
[ "services" "nextcloud" "config" "extraTrustedDomains" ] [ "services" "nextcloud" "settings" "trusted_domains" ])
|
||||
(mkRenamedOptionModule
|
||||
[ "services" "nextcloud" "config" "trustedProxies" ] [ "services" "nextcloud" "extraOptions" "trusted_proxies" ])
|
||||
[ "services" "nextcloud" "config" "trustedProxies" ] [ "services" "nextcloud" "settings" "trusted_proxies" ])
|
||||
(mkRenamedOptionModule ["services" "nextcloud" "extraOptions" ] [ "services" "nextcloud" "settings" ])
|
||||
];
|
||||
|
||||
options.services.nextcloud = {
|
||||
|
@ -648,7 +649,7 @@ in {
|
|||
'';
|
||||
};
|
||||
|
||||
extraOptions = mkOption {
|
||||
settings = mkOption {
|
||||
type = types.submodule {
|
||||
freeformType = jsonFormat.type;
|
||||
options = {
|
||||
|
@ -770,7 +771,7 @@ in {
|
|||
default = null;
|
||||
description = lib.mdDoc ''
|
||||
Secret options which will be appended to Nextcloud's config.php file (written as JSON, in the same
|
||||
form as the [](#opt-services.nextcloud.extraOptions) option), for example
|
||||
form as the [](#opt-services.nextcloud.settings) option), for example
|
||||
`{"redis":{"password":"secret"}}`.
|
||||
'';
|
||||
};
|
||||
|
@ -930,7 +931,7 @@ in {
|
|||
(i: v: ''
|
||||
${occ}/bin/nextcloud-occ config:system:set trusted_domains \
|
||||
${toString i} --value="${toString v}"
|
||||
'') ([ cfg.hostName ] ++ cfg.extraOptions.trusted_domains));
|
||||
'') ([ cfg.hostName ] ++ cfg.settings.trusted_domains));
|
||||
|
||||
in {
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
@ -1056,7 +1057,7 @@ in {
|
|||
|
||||
services.nextcloud = {
|
||||
caching.redis = lib.mkIf cfg.configureRedis true;
|
||||
extraOptions = mkMerge [({
|
||||
settings = mkMerge [({
|
||||
datadirectory = lib.mkDefault "${datadir}/data";
|
||||
trusted_domains = [ cfg.hostName ];
|
||||
}) (lib.mkIf cfg.configureRedis {
|
||||
|
|
|
@ -41,7 +41,7 @@ in {
|
|||
};
|
||||
secretFile = "/etc/nextcloud-secrets.json";
|
||||
|
||||
extraOptions = {
|
||||
settings = {
|
||||
allow_local_remote_servers = true;
|
||||
redis = {
|
||||
dbindex = 0;
|
||||
|
|
|
@ -41,7 +41,7 @@ in {
|
|||
extraApps = {
|
||||
inherit (pkgs."nextcloud${lib.versions.major config.services.nextcloud.package.version}Packages".apps) notify_push;
|
||||
};
|
||||
extraOptions.trusted_proxies = [ "::1" ];
|
||||
settings.trusted_proxies = [ "::1" ];
|
||||
};
|
||||
|
||||
services.redis.servers."nextcloud".enable = true;
|
||||
|
|
Loading…
Reference in a new issue