8 inherit (lib.types) package str;
15 cfg = config.services.dashy;
18 options.services.dashy = {
19 enable = mkEnableOption ''
20 Dashy, a highly customizable, easy to use, privacy-respecting dashboard app.
22 Note that this builds a static web app as opposed to running a full node server, unlike the default docker image.
24 Writing config changes to disk through the UI, triggering a rebuild through the UI and application status checks are
25 unavailable without the node server; Everything else will work fine.
27 See the deployment docs for [building from source](https://dashy.to/docs/deployment#build-from-source), [hosting with a CDN](https://dashy.to/docs/deployment#hosting-with-cdn) and [CDN cloud deploy](https://dashy.to/docs/deployment#cdn--cloud-deploy) for more information.
31 enableNginx = mkEnableOption "a virtualhost to serve dashy through nginx";
35 Domain to use for the virtual host.
37 This can be used to change nginx options like
39 services.nginx.virtualHosts."$\{config.services.dashy.virtualHost.domain}".listen = [ ... ]
43 services.nginx.virtualHosts."example.com".listen = [ ... ]
50 package = mkPackageOption pkgs "dashy-ui" { };
55 if cfg.settings != { } then cfg.package.override { inherit (cfg) settings; } else cfg.package;
58 then cfg.package.override {inherit (cfg) settings;}
63 Final derivation containing the fully built static files
70 Settings serialized into `user-data/conf.yml` before build.
71 If left empty, the default configuration shipped with the package will be used instead.
73 Note that the full configuration will be written to the nix store as world readable, which may include secrets such as [password hashes](https://dashy.to/docs/configuring#appconfigauthusers-optional).
75 To add files such as icons or backgrounds, you can reference them in line such as
77 icon = "$\{./icon.png}";
79 This will add the file to the nix store upon build, referencing it by file path as expected by Dashy.
88 enableFontAwesome = true;
89 fontAwesomeKey = "e9076c7025";
93 description = "My Awesome Dashboard";
100 path = "https://example.com";
104 path = "https://example.com";
115 customStyles = "border: 2px dashed red;";
120 backgroundColor = "#0079ff";
122 description = "Source code and documentation on GitHub";
123 icon = "fab fa-github";
126 url = "https://github.com/Lissy93/dashy";
129 description = "View currently open issues, or raise a new one";
132 url = "https://github.com/Lissy93/dashy/issues";
135 description = "Live Demo #1";
136 icon = "fas fa-rocket";
139 url = "https://dashy-demo-1.as93.net";
142 description = "Live Demo #2";
146 url = "https://dashy-demo-2.as93.net";
149 name = "Getting Started";
154 inherit (pkgs.formats.json { }) type;
158 config = mkIf cfg.enable {
159 services.nginx = mkIf cfg.virtualHost.enableNginx {
161 virtualHosts."${cfg.virtualHost.domain}" = {
164 tryFiles = "$uri /index.html ";
171 lib.maintainers.therealgramdalf