From a200642072bcfe74fcc352c9cd15bdd671fb26e0 Mon Sep 17 00:00:00 2001 From: Lillian-Violet Date: Sun, 31 Mar 2024 22:06:47 +0200 Subject: [PATCH] Enable cinny web server via docker --- .../server/package-configs/cinny/default.nix | 31 +++++++++++++++++++ nixos/server/package-configs/default.nix | 1 + 2 files changed, 32 insertions(+) create mode 100644 nixos/server/package-configs/cinny/default.nix diff --git a/nixos/server/package-configs/cinny/default.nix b/nixos/server/package-configs/cinny/default.nix new file mode 100644 index 0000000..5f7d160 --- /dev/null +++ b/nixos/server/package-configs/cinny/default.nix @@ -0,0 +1,31 @@ +{ + config, + pkgs, + inputs, + lib, + ... +}: let + port = 2143; +in { + virtualisation.oci-containers.containers."cinny" = { + autoStart = true; + ports = ["${toString port}:80"]; + image = "cinny:latest"; + }; + + services.nginx = { + enable = true; + virtualHosts = { + "cinny.gladtherescake.eu" = { + ## Force HTTP redirect to HTTPS + forceSSL = true; + ## LetsEncrypt + enableACME = true; + locations."/" = { + proxyPass = "http://localhost:${toString port}"; + proxyWebsockets = true; + }; + }; + }; + }; +} diff --git a/nixos/server/package-configs/default.nix b/nixos/server/package-configs/default.nix index ff7d535..4263264 100644 --- a/nixos/server/package-configs/default.nix +++ b/nixos/server/package-configs/default.nix @@ -16,5 +16,6 @@ ./roundcube ./coturn ./dashboard + ./cinny ]; }