From 515610481e7769a328d936e457d4eeff20696283 Mon Sep 17 00:00:00 2001 From: Daniel Kempkens Date: Sun, 31 Jul 2022 00:52:43 +0200 Subject: [PATCH] webserver: Add mosquitto container --- container/webserver/config/mosquitto.nix | 4 ++-- container/webserver/default.nix | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/container/webserver/config/mosquitto.nix b/container/webserver/config/mosquitto.nix index 3ac32a5..ec49976 100644 --- a/container/webserver/config/mosquitto.nix +++ b/container/webserver/config/mosquitto.nix @@ -2,10 +2,10 @@ let secret = import ../../../secret/container/webserver.nix; in { - environment.usr."local/etc/container-webserver/mosquitto/mosquitto.conf".text = '' + environment.etc."container-webserver/mosquitto/mosquitto.conf".text = '' listener 1883 password_file /mosquitto/config/users.conf ''; - environment.usr."local/etc/container-webserver/mosquitto/users.conf".text = secret.container.webserver.mosquitto.users; + environment.etc."container-webserver/mosquitto/users.conf".text = secret.container.webserver.mosquitto.users; } diff --git a/container/webserver/default.nix b/container/webserver/default.nix index c21566a..83c52c5 100644 --- a/container/webserver/default.nix +++ b/container/webserver/default.nix @@ -21,6 +21,20 @@ in }; }; + mosquitto = { + service = { + image = "eclipse-mosquitto:2"; + container_name = "mosquitto"; + restart = "always"; + depends_on = [ "ipv6nat" ]; + networks = [ "webserver" ]; + ports = [ "1883:1883" ]; + volumes = [ + "/etc/container-webserver/mosquitto:/mosquitto/config:ro" + ]; + }; + }; + ifconfig-sexy = { service = { image = "ghcr.io/nifoc/ifconfig.sexy-caddy:master";