Bruno BELANYI
de64f025a1
TODO: * Do home-manager * Look at for more inspiration github.com:nix-community/impermanence/pull/108 * Common files github.com:nix-community/impermanence/issues/10 * Useful config: github.com:chayleaf/dotfiles/blob/f77271b249e0c08368573c22a5c34f0737d3a766/system/modules/impermanence.nix
53 lines
1.1 KiB
Nix
53 lines
1.1 KiB
Nix
# Document editor with Nextcloud
|
|
{ config, lib, ... }:
|
|
let
|
|
cfg = config.my.services.nextcloud.collabora;
|
|
in
|
|
{
|
|
options.my.services.nextcloud.collabora = with lib; {
|
|
enable = mkEnableOption "Collabora integration";
|
|
|
|
port = mkOption {
|
|
type = types.port;
|
|
default = 9980;
|
|
example = 8080;
|
|
description = "Internal port for API";
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
services.collabora-online = {
|
|
enable = true;
|
|
inherit (cfg) port;
|
|
|
|
aliasGroups = [
|
|
{
|
|
host = "https://collabora.${config.networking.domain}";
|
|
# Allow using from nextcloud
|
|
aliases = [ "https://${config.services.nextcloud.hostName}" ];
|
|
}
|
|
];
|
|
|
|
settings = {
|
|
# Rely on reverse proxy for SSL
|
|
ssl = {
|
|
enable = false;
|
|
termination = true;
|
|
};
|
|
};
|
|
};
|
|
|
|
my.services.nginx.virtualHosts = {
|
|
collabora = {
|
|
inherit (cfg) port;
|
|
websocketsLocations = [
|
|
"~ ^/cool/(.*)/ws$"
|
|
"^~ /cool/adminws"
|
|
];
|
|
};
|
|
};
|
|
|
|
# FIXME: persistence?
|
|
};
|
|
}
|