diff options
| -rw-r--r-- | modules/nixos/services/web/status/default.nix | 46 | ||||
| -rw-r--r-- | packages/status/default.nix | 22 | ||||
| -rw-r--r-- | systems/x86_64-linux/copenhagen/default.nix | 1 |
3 files changed, 69 insertions, 0 deletions
diff --git a/modules/nixos/services/web/status/default.nix b/modules/nixos/services/web/status/default.nix new file mode 100644 index 0000000..b5a949f --- /dev/null +++ b/modules/nixos/services/web/status/default.nix @@ -0,0 +1,46 @@ +{ options, config, lib, pkgs, namespace, ... }: + +with lib; with lib.${namespace}; let + cfg = config.${namespace}.services.web.status; + impermanence = config.${namespace}.system.impermanence; +in { + options.${namespace}.services.web.status = with types; { + enable = mkEnableOption "status webserver"; + }; + + config = mkIf cfg.enable { + cxl.services.web.enable = true; + + environment.persistence.${impermanence.location} = { + directories = [ + "/srv/web/status" + ]; + }; + + networking.firewall.allowedTCPPorts = [ 80 443 ]; + + services.nginx = { + enable = true; + virtualHosts = { + "status.cxl.sh" = { + addSSL = true; + enableACME = true; + + locations."/" = { + recommendedProxySettings = true; + proxyPass = "http://127.0.0.1:6969/"; + }; + }; + }; + }; + + systemd.services."cxl.web.status" = { + enable = true; + wantedBy = [ "multi-user.target" ]; + + serviceConfig = { + ExecStart = "${pkgs.cxl.status}/bin/status 6969 /srv/web/status/auth"; + }; + }; + }; +} diff --git a/packages/status/default.nix b/packages/status/default.nix new file mode 100644 index 0000000..91d3767 --- /dev/null +++ b/packages/status/default.nix @@ -0,0 +1,22 @@ +{ lib, pkgs, ... }: + +pkgs.buildGoModule rec { + pname = "status"; + version = "1b1eed2494bca4add8471109481afea9fb5d4769"; + + src = pkgs.fetchFromGitHub { + owner = "CartConnoisseur"; + repo = "status"; + rev = "${version}"; + hash = "sha256-v2m5fJU2MKMDem18KS7bgYtKZAEaWRb1D/gLymzBhOw="; + }; + + vendorHash = "sha256-hkUXaFfTuewOCuo2GUhcd5mw7IgJAvLouwKaI87hFns="; + + meta = { + description = "The worst chat app ever"; + homepage = "https://github.com/CartConnoisseur/status"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ CartConnoisseur ]; + }; +} diff --git a/systems/x86_64-linux/copenhagen/default.nix b/systems/x86_64-linux/copenhagen/default.nix index 769af44..0bf108d 100644 --- a/systems/x86_64-linux/copenhagen/default.nix +++ b/systems/x86_64-linux/copenhagen/default.nix @@ -28,6 +28,7 @@ with lib; with lib.${namespace}; { landing.enable = true; images.enable = true; stargazers.enable = true; + status.enable = true; }; minecraft = { |