2023-09-29 22:59:07 +02:00
|
|
|
{ config, ... }:
|
2023-09-29 22:45:34 +02:00
|
|
|
|
2023-09-29 22:59:07 +02:00
|
|
|
let
|
|
|
|
inherit (config.users.users.collabora-office) uid;
|
|
|
|
inherit (config.users.groups.collabora-office) gid;
|
2024-05-26 16:45:38 +02:00
|
|
|
in
|
|
|
|
{
|
2023-09-29 22:45:34 +02:00
|
|
|
virtualisation.oci-containers.containers.collabora-office = {
|
|
|
|
image = "docker.io/collabora/code";
|
|
|
|
ports = [ "9980:9980" ];
|
2024-05-26 16:45:38 +02:00
|
|
|
environment =
|
|
|
|
let
|
|
|
|
mkAlias = domain: "https://" + (builtins.replaceStrings [ "." ] [ "\\." ] domain) + ":443";
|
|
|
|
in
|
|
|
|
{
|
|
|
|
server_name = "office.felschr.com";
|
|
|
|
aliasgroup1 = mkAlias "office.felschr.com";
|
|
|
|
aliasgroup2 = mkAlias "cloud.felschr.com";
|
|
|
|
extra_params = "--o:ssl.enable=false --o:ssl.termination=true";
|
|
|
|
};
|
2023-09-29 22:45:34 +02:00
|
|
|
extraOptions = [
|
2024-03-07 21:24:13 +01:00
|
|
|
"--runtime=crun"
|
2023-09-29 22:59:07 +02:00
|
|
|
"--uidmap=0:65534:1"
|
|
|
|
"--gidmap=0:65534:1"
|
|
|
|
"--uidmap=100:${toString uid}:1"
|
|
|
|
"--gidmap=101:${toString gid}:1"
|
2023-09-29 22:45:34 +02:00
|
|
|
"--network=host"
|
|
|
|
"--cap-add=MKNOD"
|
2024-03-07 21:24:13 +01:00
|
|
|
"--cap-add=CHOWN"
|
|
|
|
"--cap-add=FOWNER"
|
|
|
|
"--cap-add=SYS_CHROOT"
|
2023-09-29 22:45:34 +02:00
|
|
|
"--label=io.containers.autoupdate=registry"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
services.nginx.virtualHosts."office.felschr.com" = {
|
|
|
|
forceSSL = true;
|
|
|
|
enableACME = true;
|
|
|
|
locations."/" = {
|
|
|
|
proxyPass = "http://127.0.0.1:9980";
|
|
|
|
proxyWebsockets = true;
|
|
|
|
extraConfig = ''
|
|
|
|
proxy_read_timeout 36000s;
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
2023-09-29 22:59:07 +02:00
|
|
|
|
|
|
|
users.users.collabora-office = {
|
|
|
|
isSystemUser = true;
|
|
|
|
group = "collabora-office";
|
|
|
|
uid = 982;
|
|
|
|
};
|
|
|
|
|
2024-05-26 16:45:38 +02:00
|
|
|
users.groups.collabora-office = {
|
|
|
|
gid = 982;
|
|
|
|
};
|
2023-09-29 22:45:34 +02:00
|
|
|
}
|