nixpkgs/pkgs/by-name/ri/rime-data/generateFetchSchema.sh
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

44 lines
858 B
Bash
Executable File

#!/usr/bin/env nix-shell
#!nix-shell -i bash -p nix-prefetch-git -p jq
imlist=(
array
bopomofo
cangjie
cantonese
combo-pinyin
double-pinyin
emoji
essay
ipa
jyutping
luna-pinyin
middle-chinese
pinyin-simp
prelude
quick
scj
soutzoe
stenotype
stroke
terra-pinyin
wubi
wugniu
)
echo "# Generated using generateFetchSchema.sh"
echo "fetchFromGitHub:"
echo \'\'
echo "mkdir -p package/rime"
for im in ${imlist[@]}; do
tempFile=$(mktemp)
echo "ln -sv \${fetchFromGitHub {"
echo " owner = \"rime\";"
echo " repo = \"rime-$im\";"
nix-prefetch-git --quiet https://github.com/rime/rime-$im \
| jq '{ rev: .rev, sha256: .sha256 }' \
| jq -r 'to_entries | map(" \(.key) = \"\(.value)\";") | .[]'
echo "}} package/rime/$im"
done
echo \'\'