From 4b11dbf1d46213030467c18ae829948bad10ac7c Mon Sep 17 00:00:00 2001 From: hexchen Date: Sat, 7 Aug 2021 12:27:49 +0000 Subject: [PATCH] services/thelounge: move to parsons --- hosts/hainich/configuration.nix | 1 - hosts/parsons/configuration.nix | 3 ++- .../services => services}/thelounge.nix | 24 ++++++++++++------- 3 files changed, 18 insertions(+), 10 deletions(-) rename {hosts/hainich/services => services}/thelounge.nix (73%) diff --git a/hosts/hainich/configuration.nix b/hosts/hainich/configuration.nix index 56bf605..b36b0ab 100644 --- a/hosts/hainich/configuration.nix +++ b/hosts/hainich/configuration.nix @@ -20,7 +20,6 @@ ./services/monitoring.nix ./services/workadventure.nix ./services/mattermost.nix - ./services/thelounge.nix ]; boot.loader.grub.enable = true; boot.loader.grub.version = 2; diff --git a/hosts/parsons/configuration.nix b/hosts/parsons/configuration.nix index dfd7b0f..9524b3d 100644 --- a/hosts/parsons/configuration.nix +++ b/hosts/parsons/configuration.nix @@ -9,7 +9,8 @@ ((import sources.nix-hexchen) {}).profiles.nopersist ../../services/nextcloud - ../../services/mattermost.nix + ../../services/mattermost.nix + ../../services/thelounge.nix ]; hexchen.encboot = { diff --git a/hosts/hainich/services/thelounge.nix b/services/thelounge.nix similarity index 73% rename from hosts/hainich/services/thelounge.nix rename to services/thelounge.nix index 1ce4c72..0cfb051 100644 --- a/hosts/hainich/services/thelounge.nix +++ b/services/thelounge.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ config, lib, pkgs, evalConfig, ... }: let # necessary since overlays won't propagate into the @@ -9,10 +9,20 @@ in containers.thelounge = { autoStart = true; privateNetwork = true; - hostAddress = "192.168.100.70"; - localAddress = "192.168.100.71"; + hostAddress = "192.168.100.1"; + localAddress = "192.168.100.4"; - config = {pkgs, config, ...}: { + 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; @@ -30,7 +40,7 @@ in # yes, please do actually check the cert … rejectUnauthorized = true; nick = "Guest%%%%"; - join = "#thelounge"; + join = "#hacc-webchat"; }; lockNetwork = true; @@ -55,9 +65,7 @@ in # override the package we use systemd.services.thelounge.serviceConfig.ExecStart = pkgs.lib.mkForce "${thelounge}/bin/thelounge start"; - - networking.firewall.allowedTCPPorts = [ 9000 ]; - }; + })).config.system.build.toplevel; }; services.nginx.virtualHosts."webchat.voc.hacc.space" = {