From 42df69164dbc74e5ddb54f5a7a01fd66260fef57 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sat, 14 Jun 2025 16:40:48 +0530 Subject: Switch to coredns + refactor dns hosts mapping into service + more refactor --- modules/dashboard/bacchus-dashboard.service.nix | 47 ------------------------- 1 file changed, 47 deletions(-) delete mode 100644 modules/dashboard/bacchus-dashboard.service.nix (limited to 'modules/dashboard/bacchus-dashboard.service.nix') diff --git a/modules/dashboard/bacchus-dashboard.service.nix b/modules/dashboard/bacchus-dashboard.service.nix deleted file mode 100644 index 8b0fcb9..0000000 --- a/modules/dashboard/bacchus-dashboard.service.nix +++ /dev/null @@ -1,47 +0,0 @@ -{ config, lib, pkgs, ... }: -with lib; -let - cfg = config.services.bacchus-dashboard; - - rootHTML = import ./dashboard-template.nix cfg; - indexHTMLFile = pkgs.writeText "index.html" rootHTML; - - pageDir = pkgs.stdenv.mkDerivation { - pname = "dashboard-page"; - version = "0.0.0"; - unpackPhase = "true"; # no source - installPhase = '' - mkdir -p $out; - cp ${indexHTMLFile} $out/index.html; - ''; - }; -in -{ - options.services.bacchus-dashboard = { - enable = mkEnableOption "Enable dashboard"; - title = mkOption { type = types.str; default = "Dashboard"; }; - links = mkOption { - type = types.listOf (types.attrs); - default = []; - }; - embedLink = mkOption { type = types.str; }; - openFirewall = mkEnableOption "Open firewall ports"; - host = mkOption { type = types.str; default = "_"; }; - port = mkOption { type = types.int; default = 80; }; - }; - - config = { - services.nginx = mkIf cfg.enable { - enable = true; - virtualHosts.${cfg.host} = { - listen = [ { addr = toString cfg.port; } ]; - locations."/" = { - root = pageDir; - tryFiles = "$uri /index.html"; - }; - }; - }; - - networking.firewall.allowedTCPPorts = mkIf cfg.openFirewall [ 80 ]; - }; -} -- cgit v1.3.1