diff --git a/dashy.yaml b/dashy.yaml new file mode 100644 index 0000000..1390894 --- /dev/null +++ b/dashy.yaml @@ -0,0 +1,108 @@ +pageInfo: + title: Dashy + navLinks: + - title: Documentation + path: https://dashy.to/docs +appConfig: + theme: nord + layout: auto + iconSize: medium + language: en + defaultOpeningMethod: sametab + webSearch: + searchEngine: google + openingMethod: sametab +sections: + - name: Local Devices + icon: fas fa-network-wired + items: + - title: EdgeRouter 4 + icon: fas fa-router + url: https://router.home.yori.cc + - title: Unifi + icon: hl-unifi-controller + url: https://unifi.yori.cc/ + - title: EdgeSwitch 8 + icon: fas fa-ethernet + url: https://192.168.2.62/ + - title: Scanner + url: http://192.168.2.49/ + icon: fas fa-scanner-image + - title: Printer + url: "http://[2a02:a464:5ed:1:3205:5cff:fe44:20a7]/" + icon: fas fa-print + - name: Media + icon: fas fa-photo-video + items: + - title: Plex + icon: hl-plex + url: https://plex.yori.cc/web/index.html + - title: Sonarr + icon: hl-sonarr + url: https://priv.yori.cc/sonarr + - title: Radarr + icon: hl-radarr + url: https://priv.yori.cc/radarr + - title: Calibre + icon: hl-calibre-web + url: https://calibre.yori.cc/ + - name: Monitoring + icon: fas fa-tachometer-alt-fast + displayData: + sortBy: default + rows: 1 + cols: 1 + collapsed: false + hideForGuests: false + items: + - title: Grafana + icon: hl-grafana + url: https://grafana.yori.cc + - title: Prometheus + icon: hl-prometheus + url: https://prometheus.yori.cc + - title: Home Assistant + icon: hl-home-assistant + url: https://home-assistant.yori.cc + - name: Public + icon: fas fa-globe + items: + - title: yori.cc + icon: mdi-account-box + url: https://yorickvanpelt.nl + statusCheck: true + - title: Gitea + icon: hl-gitea + url: https://git.yori.cc/ + - name: Frequently Used + icon: fas fa-link + displayData: + cols: 2 + items: + - title: Youtube + icon: fab fa-youtube + url: https://youtube.com + - title: NOS + icon: hl-nos + url: https://nos.nl + - title: Hacker News + icon: fab fa-hacker-news + url: https://news.ycombinator.com + - title: De Gelderlander + icon: fas fa-newspaper + url: https://gelderlander.nl + - title: reddit + icon: fab fa-reddit + url: https://reddit.com/ + - title: newsblur + icon: hl-newsblur + url: https://newsblur.com + - title: GMail + icon: mdi-gmail + url: https://mail.google.com + - title: ChatGPT + icon: hl-chatgpt + url: https://chat.openai.com + - title: GitHub + icon: fab fa-github + url: https://github.com diff --git a/flake.nix b/flake.nix index 75aa207..38013ed 100644 --- a/flake.nix +++ b/flake.nix @@ -34,6 +34,10 @@ allowUnfree = true; # chromium.vaapiSupport = true; android_sdk.accept_license = true; + # todo: dashy + permittedInsecurePackages = [ + "nodejs-16.20.2" + ]; }; inherit system; overlays = [ self.overlays.default ]; diff --git a/nixos/machines/frumar/default.nix b/nixos/machines/frumar/default.nix index ecfb1ad..a01c558 100644 --- a/nixos/machines/frumar/default.nix +++ b/nixos/machines/frumar/default.nix @@ -222,4 +222,9 @@ nginx.virtualHosts = [ "priv.yori.cc" ]; extraConfig.whitelist-domain = ["priv.yori.cc"]; }; + services.dashy = { + enable = true; + host = "127.0.0.1"; + configFile = "${../../../dashy.yaml}"; + }; } diff --git a/nixos/modules/dashy.nix b/nixos/modules/dashy.nix new file mode 100644 index 0000000..9419088 --- /dev/null +++ b/nixos/modules/dashy.nix @@ -0,0 +1,39 @@ +{ config, lib, pkgs, ... }: +let cfg = config.services.dashy; in +{ + options.services.dashy = with lib; { + enable = mkEnableOption "Dashy server"; + host = mkOption { + default = "0.0.0.0"; + type = types.str; + }; + port = mkOption { + default = 4000; + type = types.port; + }; + package = mkOption { + default = pkgs.dashy; + type = types.package; + }; + configFile = mkOption { + type = types.path; + }; + }; + config = lib.mkIf cfg.enable { + systemd.services.dashy = { + after = [ "network.target" ]; + wantedBy = [ "multi-user.target" ]; + serviceConfig = { + Type = "simple"; + DynamicUser = true; + Restart = "on-failure"; + ExecStart = "${pkgs.nodejs}/bin/node ${cfg.package}/server.js"; + WorkingDirectory = "${cfg.package}"; + BindReadOnlyPaths = [ "/etc/dashy.yml" ]; + }; + environment.HOST = cfg.host; + environment.PORT = toString cfg.port; + }; + environment.etc."dashy.yml".source = cfg.configFile; + }; +} diff --git a/nixos/roles/default.nix b/nixos/roles/default.nix index 2c9eb7c..2f56b3b 100644 --- a/nixos/roles/default.nix +++ b/nixos/roles/default.nix @@ -5,6 +5,7 @@ let in { imports = [ inputs.agenix.nixosModules.default + ../modules/dashy.nix ../modules/tor-hidden-service.nix ../modules/nginx.nix ../modules/lumi-cache.nix diff --git a/pkgs/dashy.nix b/pkgs/dashy.nix new file mode 100644 index 0000000..5c47451 --- /dev/null +++ b/pkgs/dashy.nix @@ -0,0 +1,22 @@ +{ stdenv, fetchFromGitHub, buildYarnPackage, nodejs }: + +buildYarnPackage { + src = fetchFromGitHub { + owner = "Lissy93"; + repo = "dashy"; + rev = "edeeb74c6ce1f86ae1806f1839723b640c326ace"; + hash = "sha256-WCnyq0MrsuUDt+owN/Ry5cVbvMmo5GVB0QFdCHZ8mxk="; + }; + pname = "dashy"; + version = "2023-09-23"; + NODE_OPTIONS="--openssl-legacy-provider"; + yarnBuildMore = "yarn run build --offline"; + # for the widgets, I think you need to + # cp dashy.yml ./public/conf.yml in the preBuild + postInstall = '' + rm -r $out/dist + mv ./dist $out/dist + rm -r $out/yarn-cache + ln -fs /etc/dashy.yml $out/dist/conf.yml + ''; +} diff --git a/pkgs/default.nix b/pkgs/default.nix index 8341a69..9e261b0 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -71,6 +71,12 @@ inherit (self.nix-npm-buildpackage) buildYarnPackage; electron_26 = self.electron_27; }; + dashy = self.callPackage ./dashy.nix { + inherit (self.nix-npm-buildpackage.override { + nodejs = self.nodejs_16; + yarn = self.yarn.override { nodejs = self.nodejs_16; }; + }) buildYarnPackage; + }; r8-cog = self.stdenvNoCC.mkDerivation rec { pname = "cog"; version = "0.8.6";