diff --git a/hosts/caddy/dashy-settings.nix b/hosts/caddy/dashy-settings.nix new file mode 100644 index 0000000..f0a2400 --- /dev/null +++ b/hosts/caddy/dashy-settings.nix @@ -0,0 +1,72 @@ +{ + + appConfig = { + cssThemes = [ + "example-theme-1" + "example-theme-2" + ]; + enableFontAwesome = true; + fontAwesomeKey = "e9076c7025"; + theme = "thebe"; + }; + pageInfo = { + description = "My Awesome Dashboard"; + navLinks = [ + { + path = "/"; + title = "Home"; + } + { + path = "https://example.com"; + title = "Example 1"; + } + { + path = "https://example.com"; + title = "Example 2"; + } + ]; + title = "Dashy"; + }; + sections = [ + { + displayData = { + collapsed = true; + cols = 2; + customStyles = "border: 2px dashed red;"; + itemSize = "large"; + }; + items = [ + { + backgroundColor = "#0079ff"; + color = "#00ffc9"; + description = "Source code and documentation on GitHub"; + icon = "fab fa-github"; + target = "sametab"; + title = "Source"; + url = "https://github.com/Lissy93/dashy"; + } + { + description = "View currently open issues, or raise a new one"; + icon = "fas fa-bug"; + title = "Issues"; + url = "https://github.com/Lissy93/dashy/issues"; + } + { + description = "Live Demo #1"; + icon = "fas fa-rocket"; + target = "iframe"; + title = "Demo 1"; + url = "https://dashy-demo-1.as93.net"; + } + { + description = "Live Demo #2"; + icon = "favicon"; + target = "newtab"; + title = "Demo 2"; + url = "https://dashy-demo-2.as93.net"; + } + ]; + name = "Getting Started"; + } + ]; +} diff --git a/modules/services/dashy.nix b/modules/services/dashy.nix new file mode 100644 index 0000000..4b5d5af --- /dev/null +++ b/modules/services/dashy.nix @@ -0,0 +1,61 @@ +{ + lib, + config, + pkgs, + ... +}: +let + cfg = config.my.services.dashy; +in +{ + + options.my.services.dashy = { + enable = lib.mkEnableOption "Enable Dashy module"; + + settings = lib.mkOption { + default = { }; + description = '' + Dashy settings as described here: https://search.nixos.org/options?type=packages&query=services.dashy.settings + ''; + inherit (pkgs.formats.json { }) type; + }; + + proxy = { + enable = lib.mkEnableOption "Set the proxy entry for this service"; + + domain = lib.mkOption { + default = "example.com"; + type = lib.types.str; + description = '' + The domain where Caddy is reachable + ''; + }; + + host = lib.mkOption { + default = "localhost"; + type = lib.types.str; + description = '' + host name where the service is running + ''; + }; + + }; + }; + + config = lib.mkMerge [ + (lib.mkIf cfg.enable { + + services.dashy.enable = true; + + }) + + (lib.mkIf cfg.proxy.enable { + services.caddy = with cfg.proxy; { + virtualHosts."home.${domain}".extraConfig = '' + file_server ${config.services.dashy.finalDrv} + import cloudflare_${domain} + ''; + }; + }) + ]; +} diff --git a/modules/services/default.nix b/modules/services/default.nix index 9736553..a41b26e 100644 --- a/modules/services/default.nix +++ b/modules/services/default.nix @@ -1,10 +1,11 @@ { imports = [ + ./dashy.nix ./media-mgr.nix ./nextcloud.nix ./plex.nix ./postgres.nix - # ./searx.nix + ./searx.nix ./vaultwarden.nix ]; }