From aebf2039bb2c336e40d98de3082848e4d39c35c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Qui=C3=B1ones?= Date: Sun, 18 Jan 2026 16:19:44 -0500 Subject: [PATCH] feat(hm-module): only download zen mods when necessary (#205) --- hm-module.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hm-module.nix b/hm-module.nix index f5b00d9..0e9b132 100644 --- a/hm-module.nix +++ b/hm-module.nix @@ -919,6 +919,11 @@ in { # Install/update current mods for mod_uuid in $MODS; do + MOD_DIR="$BASE_DIR/chrome/zen-themes/$mod_uuid" + if [ -d "$MOD_DIR" ]; then + continue + fi + THEME_URL="https://raw.githubusercontent.com/zen-browser/theme-store/main/themes/$mod_uuid/theme.json" echo "Fetching mod $mod_uuid from $THEME_URL" @@ -937,12 +942,10 @@ in { ${lib.getExe pkgs.jq} --arg uuid "$mod_uuid" --argjson theme "$THEME_JSON" '.[$uuid] = $theme' "$THEMES_FILE" > "$THEMES_FILE.tmp" && mv "$THEMES_FILE.tmp" "$THEMES_FILE" # Download mod files - MOD_DIR="$BASE_DIR/chrome/zen-themes/$mod_uuid" mkdir -p "$MOD_DIR" for file in chrome.css preferences.json readme.md; do FILE_URL="https://raw.githubusercontent.com/zen-browser/theme-store/main/themes/$mod_uuid/$file" - echo "Downloading $file for mod $mod_uuid" ${lib.getExe pkgs.curl} -s "$FILE_URL" -o "$MOD_DIR/$file" || true done done