housou-kinshi-yougo: init

This commit is contained in:
2026-06-01 17:21:38 +09:00
parent 3bfbe91a7d
commit 17ef881254
5 changed files with 2635 additions and 0 deletions
+14
View File
@@ -65,3 +65,17 @@ jobs:
else
echo "No changes to commit"
fi
- name: Update housou-kinshi-yougo
run: |
nix run .#update-housou-kinshi-yougo
if ! git diff --quiet; then
OLD_VERSION=$(git show HEAD:./housou-kinshi-yougo/version.txt)
NEW_VERSION=$(cat ./housou-kinshi-yougo/version.txt)
git add housou-kinshi-yougo
git commit -m "housou-kinshi-yougo: $OLD_VERSION -> $NEW_VERSION"
git push
else
echo "No changes to commit"
fi
+30
View File
@@ -38,6 +38,7 @@
update-jmdict = wrapUpdateScript "jmdict" ./scripts/update-jmdict.sh;
update-kanjidic2 = wrapUpdateScript "kanjidic2" ./scripts/update-kanjidic2.sh;
update-radkfile = wrapUpdateScript "radkfile" ./scripts/update-radkfile.sh;
update-housou-kinshi-yougo = wrapUpdateScript "housou-kinshi-yougo" ./scripts/update-housou-kinshi-yougo.sh;
});
packages = let
@@ -133,6 +134,35 @@
};
});
housou-kinshi-yougo = pkgs.stdenvNoCC.mkDerivation (finalAttrs: {
pname = "housou-kinshi-yougo";
version = lib.fileContents ./housou-kinshi-yougo/version.txt;
src = ././housou-kinshi-yougo/./housou-kinshi-yougo.xml;
dontUnpack = true;
dontBuild = true;
installPhase = ''
runHook preInstall
install -Dm644 "$src" "$out/housou-kinshi-yougo.xml"
runHook postInstall
'';
passthru = {
hash = lib.hashFile "sha256" finalAttrs.src;
date = lib.fileContents ./housou-kinshi-yougo/version.txt;
};
meta = {
description = "An XML file containing Japanese vocabulary banned from being broadcasted";
homepage = "https://monoroch.net/kinshi/";
license = lib.licenses.free;
maintainers = [ lib.maintainers.h7x4 ];
platforms = lib.platforms.all;
};
});
tanos-jlpt = pkgs.stdenvNoCC.mkDerivation (finalAttrs: {
pname = "tanos-jlpt";
version = "2011";
File diff suppressed because it is too large Load Diff
+1
View File
@@ -0,0 +1 @@
2011-03-04
+23
View File
@@ -0,0 +1,23 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p coreutils curl gitMinimal gzip gnugrep gnused xmlformat yq
set -euo pipefail
set -x
XML_URL='https://monoroch.net/kinshi/housouKinshiYougo.xml'
TMP="$(mktemp -d)"
PROJECT_ROOT="$(git rev-parse --show-toplevel)"
DATA_DIR="$PROJECT_ROOT/housou-kinshi-yougo"
function cleanup {
rm -rf "$TMP"
}
trap cleanup EXIT
curl -L -o "$TMP/housou-kinshi-yougo.xml" "$XML_URL"
xmlformat "$TMP/housou-kinshi-yougo.xml" > "$DATA_DIR/housou-kinshi-yougo.xml"
xq -r '.housouKinshiYougoList."@date"' "$DATA_DIR/housou-kinshi-yougo.xml" > "$DATA_DIR/version.txt"
cleanup