nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at 21.05 29 lines 997 B view raw
1#!/usr/bin/env nix-shell 2#!nix-shell -i python3 -p nix-prefetch-github python3Packages.requests 3 4from nix_prefetch_github import * 5import json 6import requests 7import subprocess 8 9REPOS = [ "libime", "xcb-imdkit", "fcitx5", "fcitx5-gtk", "fcitx5-qt", "fcitx5-configtool", "fcitx5-lua", 10 "fcitx5-rime", "fcitx5-chinese-addons", "fcitx5-table-extra", "fcitx5-table-other" ] 11 12OWNER = "fcitx" 13 14def get_latest_tag(repo, owner=OWNER): 15 r = requests.get( 'https://api.github.com/repos/{}/{}/tags'.format(owner,repo) 16 , auth=('poscat', 'db5e6fd16d0eb8c36385d3d944e058a1178b4265')) 17 return r.json()[0].get("name") 18 19def main(): 20 sources = dict() 21 for repo in REPOS: 22 rev = get_latest_tag(repo) 23 if repo == "fcitx5-qt": 24 subprocess.run(["nix-update", "--commit", "--version", rev, "libsForQt5.{}".format(repo)]) 25 else: 26 subprocess.run(["nix-update", "--commit", "--version", rev, repo]) 27 28if __name__ == "__main__": 29 main ()