feat(nextcloud): Deploy collabora without docker #184

Merged
thubrecht merged 1 commit from collabora-online into main 2024-12-11 14:54:25 +01:00
2 changed files with 164 additions and 157 deletions

View file

@ -1,4 +1,9 @@
{ config, pkgs, ... }:
{
config,
pkgs,
nixpkgs,
...
}:
let
host = "cloud.dgnum.eu";
@ -7,7 +12,9 @@ let
port = 9980;
in
{
services.nextcloud = {
services = {
nextcloud = {
enable = true;
hostName = host;
@ -87,43 +94,30 @@ in
};
};
virtualisation = {
podman = {
collabora-online = {
enable = true;
defaultNetwork.settings = {
dns_enable = true;
ipv6_enabled = true;
};
};
inherit port;
package = nixpkgs.nixos.unstable.collabora-online;
settings = {
server_name = "code.dgnum.eu";
ssl = {
enable = false;
termination = true;
};
virtualisation.oci-containers = {
containers.collabora = {
image = "collabora/code";
imageFile = pkgs.dockerTools.pullImage {
imageName = "collabora/code";
imageDigest = "sha256:07da8a191b37058514dfdf921ea8c2270c6634fa659acee774cf8594f86950e4";
sha256 = "sha256-5oaz07NQScHUVN/HznzZGQ2bGrU/V1GhI+9btXHz0GM=";
};
ports = [ "${builtins.toString port}:${builtins.toString port}" ];
environment = {
domain = "cloud.dgnum.eu";
extra_params = "--o:ssl.enable=false --o:ssl.termination=true --o:remote_font_config.url=https://cloud.dgnum.eu/apps/richdocuments/settings/fonts.json";
};
extraOptions = [
"--network=host"
"--cap-add"
"MKNOD"
"--cap-add"
"SYS_ADMIN"
];
};
remote_font_config.url = "https://cloud.dgnum.eu/apps/richdocuments/settings/fonts.json";
net.proto = "IPv4";
};
dgn-web.internalPorts.collabora = port;
aliasGroups = [ { host = "https://cloud.dgnum.eu"; } ];
};
services.nginx.virtualHosts = {
nginx.virtualHosts = {
${host} = {
enableACME = true;
forceSSL = true;
@ -182,6 +176,9 @@ in
'';
};
};
};
dgn-web.internalPorts.collabora = port;
systemd.services = {
nextcloud-preview = {
@ -200,6 +197,10 @@ in
networking.hosts = {
"129.199.146.148" = [ "s3.dgnum.eu" ];
"129.199.146.147" = [
"code.dgnum.eu"
"cloud.dgnum.eu"
];
};
age-secrets.autoMatch = [ "nextcloud" ];

View file

@ -48,6 +48,12 @@ in
excludes = [ ".git-blame-ignore-revs" ];
hash = "sha256-ca7CsPuWJqucC77ejsvoDAt+wxWLUP30IdXtZQVQrko=";
}
# Add Collabora Online
{
id = 330708;
hash = "sha256-655zkmch5VLXEUzhT6+b7QpywslDoIMZ8mY0II55Wlw=";
}
];
"nixos-unstable" = [