make onlyoffice config a bit nicer
This commit is contained in:
parent
bbe18df58f
commit
021c465fd6
1 changed files with 20 additions and 4 deletions
|
@ -113,14 +113,23 @@ in
|
||||||
description = ''
|
description = ''
|
||||||
Applications to enable in Nextcloud. Enabling an application here will also configure
|
Applications to enable in Nextcloud. Enabling an application here will also configure
|
||||||
various services needed for this application.
|
various services needed for this application.
|
||||||
|
|
||||||
|
Enabled apps will automatically be installed, enabled and configured, so no need to do that
|
||||||
|
through the UI. You can still make changes but they will be overridden on next deploy. You
|
||||||
|
can still install and configure other apps through the UI.
|
||||||
'';
|
'';
|
||||||
type = lib.types.submodule {
|
type = lib.types.submodule {
|
||||||
options = {
|
options = {
|
||||||
onlyoffice = lib.mkOption {
|
onlyoffice = lib.mkOption {
|
||||||
description = "If non null, set up an Only Office service.";
|
description = "If non null, set up an Only Office service.";
|
||||||
default = null;
|
default = {
|
||||||
type = lib.types.nullOr (lib.types.submodule {
|
enable = false;
|
||||||
|
jwtSecretFile = "";
|
||||||
|
};
|
||||||
|
type = lib.types.submodule {
|
||||||
options = {
|
options = {
|
||||||
|
enable = lib.mkEnableOption "Nextcloud OnlyOffice App";
|
||||||
|
|
||||||
subdomain = lib.mkOption {
|
subdomain = lib.mkOption {
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
description = "Subdomain under which Only Office will be served.";
|
description = "Subdomain under which Only Office will be served.";
|
||||||
|
@ -130,7 +139,7 @@ in
|
||||||
localNetworkIPRange = lib.mkOption {
|
localNetworkIPRange = lib.mkOption {
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
description = "Local network range, to restrict access to Open Office to only those IPs.";
|
description = "Local network range, to restrict access to Open Office to only those IPs.";
|
||||||
example = "192.168.1.1/24";
|
default = "192.168.1.1/24";
|
||||||
};
|
};
|
||||||
|
|
||||||
jwtSecretFile = lib.mkOption {
|
jwtSecretFile = lib.mkOption {
|
||||||
|
@ -344,7 +353,14 @@ in
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
|
|
||||||
(lib.mkIf (!(isNull cfg.apps.onlyoffice)) {
|
(lib.mkIf cfg.apps.onlyoffice.enable {
|
||||||
|
assertions = [
|
||||||
|
{
|
||||||
|
assertion = cfg.apps.onlyoffice.jwtSecretFile != "";
|
||||||
|
message = "Must set jwtSecretFile.";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
services.nextcloud.extraApps = {
|
services.nextcloud.extraApps = {
|
||||||
inherit (nextcloudApps) onlyoffice;
|
inherit (nextcloudApps) onlyoffice;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue