144 lines
4.1 KiB
Nix
144 lines
4.1 KiB
Nix
{ config, lib, pkgs, evalConfig, ... }:
|
|
|
|
let
|
|
# necessary since overlays won't propagate into the
|
|
# container's config
|
|
thelounge = pkgs.thelounge-hacked;
|
|
|
|
website = import ../../../pkgs/haccvoc-stage {
|
|
inherit pkgs;
|
|
config = {
|
|
baseurl = "";
|
|
meta = {
|
|
title = "noIAA Livestream dings";
|
|
description = "Die Workshops auf der noIAA Gegenkonferenz als Livestream";
|
|
};
|
|
|
|
# should be able to use anything videojs understands
|
|
videosrc = "https://cdn.media.ccc.de/congress/2019/h264-hd/36c3-11175-deu-eng-fra-Hirne_Hacken_hd.mp4";
|
|
thumbnailurl = "https://gitlab.infra4future.de/lukas/videojs-player/-/raw/main/thumbnail.jpg";
|
|
|
|
header = "Video dingsbums #noIAA";
|
|
|
|
irc = {
|
|
webchat = "https://webchat.voc.hacc.space";
|
|
# used for a fallback text in case js is disabled
|
|
room = "#hacc-webchat";
|
|
server = "irc.libera.chat";
|
|
};
|
|
|
|
description = {
|
|
title = "Dingsbeschreibung";
|
|
text = ''
|
|
<p>Lorem Ipsum dolor sit amet consecutetur ...</p>
|
|
'';
|
|
};
|
|
|
|
footer = {
|
|
text = ''
|
|
content by <a href='https://www.attac-muenchen.org/startseite'>attac München</a>
|
|
| livestream by <a href='https://hacc.earth'>hacc</a>
|
|
'';
|
|
imprint = "lalala was ist ein Impressum?";
|
|
};
|
|
};
|
|
|
|
overlays = {
|
|
"favicon.ico" = pkgs.fetchurl {
|
|
url = "https://www.attac.de/typo3conf/ext/integration_project/Resources/Public/_Default/Build/img/favicons/favicon-32x32.png";
|
|
sha256 = "19k3nd9rlvlqk0daq3mq3xrnxm9y89688v2y997714dv26hzan61";
|
|
};
|
|
|
|
"logo.png" = pkgs.fetchurl {
|
|
url = "https://shop.attac.de/media/image/47/0a/b8/logo-50-100JsYfK51WPsZI8.jpg";
|
|
sha256 = "00563rw8yxvb9jvw72w7n5w45f9z2kxnj91mfj2dx0y46h2z1ckj";
|
|
};
|
|
};
|
|
};
|
|
in
|
|
{
|
|
containers.thelounge = {
|
|
autoStart = true;
|
|
privateNetwork = true;
|
|
hostAddress = "192.168.100.1";
|
|
localAddress = "192.168.100.4";
|
|
|
|
path = (evalConfig {hosts = {}; groups = {};} ({ config, lib, pkgs, profiles, modules, sources, ... }: {
|
|
boot.isContainer = true;
|
|
networking.useDHCP = false;
|
|
users.users.root.hashedPassword = "";
|
|
|
|
nixpkgs.config.allowUnfree = true;
|
|
networking.firewall.enable = false;
|
|
networking.defaultGateway = {
|
|
address = "192.168.100.1";
|
|
interface = "eth0";
|
|
};
|
|
|
|
services.thelounge = {
|
|
enable = true;
|
|
|
|
extraConfig = {
|
|
public = true;
|
|
# respect X-Forwarded-For
|
|
reverseProxy = true;
|
|
defaults = {
|
|
name = "libera chat";
|
|
host = "irc.eu.libera.chat";
|
|
port = 6697;
|
|
# encrypt things!
|
|
tls = true;
|
|
# yes, please do actually check the cert …
|
|
rejectUnauthorized = true;
|
|
nick = "haccGuest%%%%";
|
|
join = "#hacc-webchat";
|
|
};
|
|
lockNetwork = true;
|
|
|
|
# don't log messages (default is text / sqlite)
|
|
messageStorage = [];
|
|
|
|
# darker theme
|
|
#theme = "morning";
|
|
|
|
# these three should result in having link previews
|
|
# which are fetched only by the server, then proxied
|
|
# (i.e. clients won't directly connect to arbitrary
|
|
# domains to get previews)
|
|
prefetch = true;
|
|
prefetchStorage = true;
|
|
disableMediaPreview = true;
|
|
|
|
leaveMessage = "happy haccing";
|
|
};
|
|
};
|
|
|
|
# override the package we use
|
|
systemd.services.thelounge.serviceConfig.ExecStart =
|
|
pkgs.lib.mkForce "${thelounge}/bin/thelounge start";
|
|
|
|
services.coredns = {
|
|
enable = true;
|
|
config = ''
|
|
.:53 {
|
|
forward . 1.1.1.1
|
|
}
|
|
'';
|
|
};
|
|
})).config.system.build.toplevel;
|
|
};
|
|
|
|
services.nginx.virtualHosts."webchat.voc.hacc.space" = {
|
|
locations."/".proxyPass =
|
|
"http://${config.containers.thelounge.localAddress}:9000";
|
|
enableACME = true;
|
|
forceSSL = true;
|
|
};
|
|
|
|
services.nginx.virtualHosts."live.hacc.space" = {
|
|
locations."/".root = website;
|
|
enableACME = true;
|
|
forceSSL = true;
|
|
};
|
|
}
|