Add dashy to priv.yori.cc

master
Yorick van Pelt 2023-09-24 11:51:26 +02:00
parent 17c351c5b6
commit 67343c641d
Signed by: yorick
GPG Key ID: D8D3CC6D951384DE
7 changed files with 185 additions and 0 deletions

108
dashy.yaml Normal file
View File

@ -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

View File

@ -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 ];

View File

@ -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}";
};
}

39
nixos/modules/dashy.nix Normal file
View File

@ -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;
};
}

View File

@ -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

22
pkgs/dashy.nix Normal file
View File

@ -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
'';
}

View File

@ -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";