From f509abebec8211bcfd244e481c3c72a05f16681f Mon Sep 17 00:00:00 2001 From: Daniel Kempkens Date: Sun, 31 Jul 2022 12:41:00 +0200 Subject: [PATCH] webserver: Move config into a single file --- .../{config/traefik.nix => config.nix} | 18 ++++++++++++++++++ container/webserver/config/mosquitto.nix | 17 ----------------- container/webserver/default.nix | 5 +---- 3 files changed, 19 insertions(+), 21 deletions(-) rename container/webserver/{config/traefik.nix => config.nix} (83%) delete mode 100644 container/webserver/config/mosquitto.nix diff --git a/container/webserver/config/traefik.nix b/container/webserver/config.nix similarity index 83% rename from container/webserver/config/traefik.nix rename to container/webserver/config.nix index caa6bb6..6ed4cdc 100644 --- a/container/webserver/config/traefik.nix +++ b/container/webserver/config.nix @@ -1,6 +1,24 @@ { secret, ... }: { + # mosquitto + + environment.etc."container-webserver/mosquitto/mosquitto.conf" = { + text = '' + listener 1883 + password_file /mosquitto/config/users.conf + ''; + + mode = "0644"; + }; + + environment.etc."container-webserver/mosquitto/users.conf" = { + text = secret.container.webserver.mosquitto.users; + mode = "0644"; + }; + + # traefik + environment.etc."container-webserver/traefik/traefik.toml" = { text = '' [providers] diff --git a/container/webserver/config/mosquitto.nix b/container/webserver/config/mosquitto.nix deleted file mode 100644 index f40fbec..0000000 --- a/container/webserver/config/mosquitto.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ secret, ... }: - -{ - environment.etc."container-webserver/mosquitto/mosquitto.conf" = { - text = '' - listener 1883 - password_file /mosquitto/config/users.conf - ''; - - mode = "0644"; - }; - - environment.etc."container-webserver/mosquitto/users.conf" = { - text = secret.container.webserver.mosquitto.users; - mode = "0644"; - }; -} diff --git a/container/webserver/default.nix b/container/webserver/default.nix index 5f08e37..3b42a03 100644 --- a/container/webserver/default.nix +++ b/container/webserver/default.nix @@ -1,9 +1,6 @@ let secret = import ../../secret/container/webserver.nix; - config-mosquitto = import ./config/mosquitto.nix { inherit secret; }; - config-traefik = import ./config/traefik.nix { inherit secret; }; - - custom-config = config-mosquitto // config-traefik; + custom-config = import ./config.nix { inherit secret; }; in { virtualisation.arion.projects.webserver.settings = {