feat: dashy is too slow to start/reload, replace it with homepage-dashboard

This commit is contained in:
Ryan Yin
2024-02-19 23:25:16 +08:00
parent b50c59d60e
commit c31525e667
11 changed files with 235 additions and 272 deletions
+24
View File
@@ -0,0 +1,24 @@
{pkgs, ...}: let
configDir = "/var/lib/homepage-dashboard";
in {
# https://github.com/NixOS/nixpkgs/blob/nixos-unstable/nixos/modules/services/misc/homepage-dashboard.nix
services.homepage-dashboard = {
enable = true;
listenPort = 8082;
openFirewall = false;
};
systemd.services.homepage-dashboard.environment = {
HOMEPAGE_CONFIG_DIR = configDir;
# 1. The value of env var HOMEPAGE_VAR_XXX will replace {{HOMEPAGE_VAR_XXX}} in any config
# HOMEPAGE_VAR_XXX_APIKEY = "myapikey";
# 2. The value of env var HOMEPAGE_FILE_XXX must be a file path,
# the contents of which will be used to replace {{HOMEPAGE_FILE_XXX}} in any config
};
# Install the homepage-dashboard configuration files
system.activationScripts.installHomepageDashboardConfig = ''
mkdir -p ${configDir}/config ${configDir}/images
${pkgs.rsync}/bin/rsync -avz --chmod=D2755,F600 ${./config}/ ${configDir}/config/
${pkgs.rsync}/bin/rsync -avz --chmod=D2755,F600 ${./images}/ ${configDir}/images/
'';
}