diff options
author | ene <ene@sils.li> | 2023-02-11 22:24:30 +0100 |
---|---|---|
committer | ene <ene@sils.li> | 2023-02-12 17:48:12 +0100 |
commit | 3ad750a3d977b3472a8a67acb7aa3613be7f70bb (patch) | |
tree | d3289733fa29b10c835fd8295b5c9737160c10aa /home-manager/firefox/generate-extension.py | |
parent | Fix(home-manager): Import home-manager correctly (diff) | |
download | nixos-config-3ad750a3d977b3472a8a67acb7aa3613be7f70bb.tar.gz nixos-config-3ad750a3d977b3472a8a67acb7aa3613be7f70bb.zip |
Fix(home-manager): Improve Firefox configuration
Diffstat (limited to '')
-rwxr-xr-x | home-manager/firefox/generate-extension.py | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/home-manager/firefox/generate-extension.py b/home-manager/firefox/generate-extension.py deleted file mode 100755 index cfb73542..00000000 --- a/home-manager/firefox/generate-extension.py +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env python -# source: https://github.com/etu/nixconfig/blob/ba47d577c8bfb4a1c06927c34ece34118f4a0460/modules/graphical/firefox/generate.py - -from concurrent.futures import ThreadPoolExecutor -import json -import os -import requests - -EXTENSIONS = sorted([ - "darkreader", - "firenvim", - "keepassxc-browser", - "simple-tab-groups", -]) - -def index_ext(ext: str): - print(f"Indexing {ext}...") - - resp = requests.get(f"https://addons.mozilla.org/api/v5/addons/addon/{ext}/").json() - rel = resp["current_version"] - - if not rel["file"]["hash"].startswith("sha256:"): - raise ValueError("Unhandled hash type") - - return { - "pname": ext, - "version": rel["version"], - "addonId": resp["guid"], - "url": rel["file"]["url"], - "sha256": rel["file"]["hash"], - } - -if __name__ == "__main__": - outfile = os.path.dirname(os.path.realpath(__file__)) + "/extensions.json" - - with ThreadPoolExecutor() as e: - extensions = {ext: e.submit(index_ext, ext) for ext in EXTENSIONS} - extensions = {k: v.result() for k, v in extensions.items()} - - with open(outfile, "w") as f: - json.dump(extensions, f, indent=2) |