2022-06-20 20:06:07 +02:00
|
|
|
{
|
|
|
|
description = "A SQLite database containing open source japanese language translation data";
|
|
|
|
|
|
|
|
inputs = {
|
2024-11-14 16:45:03 +01:00
|
|
|
nixpkgs.url = "nixpkgs/nixos-24.05";
|
2022-06-20 20:06:07 +02:00
|
|
|
|
|
|
|
nix-dart = {
|
|
|
|
url = "github:tadfisher/nix-dart";
|
2024-11-14 16:45:03 +01:00
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
2022-06-20 20:06:07 +02:00
|
|
|
};
|
|
|
|
|
2024-11-14 16:45:03 +01:00
|
|
|
jmdict-src = {
|
2022-06-20 20:06:07 +02:00
|
|
|
url = "http://ftp.edrdg.org/pub/Nihongo/JMdict.gz";
|
|
|
|
flake = false;
|
|
|
|
};
|
|
|
|
|
2024-11-14 16:45:03 +01:00
|
|
|
jmdict-with-examples-src = {
|
2022-06-20 20:06:07 +02:00
|
|
|
url = "http://ftp.edrdg.org/pub/Nihongo/JMdict_e_examp.gz";
|
|
|
|
flake = false;
|
|
|
|
};
|
|
|
|
|
2024-11-14 16:45:03 +01:00
|
|
|
radkfile-src = {
|
2022-06-20 20:06:07 +02:00
|
|
|
url = "http://ftp.usf.edu/pub/ftp.monash.edu.au/pub/nihongo/radkfile.gz";
|
|
|
|
flake = false;
|
|
|
|
};
|
|
|
|
|
2024-11-14 16:45:03 +01:00
|
|
|
kanjidic2-src = {
|
2022-08-18 21:39:36 +02:00
|
|
|
url = "http://nihongo.monash.edu/kanjidic2/kanjidic2.xml.gz";
|
|
|
|
flake = false;
|
|
|
|
};
|
|
|
|
|
2022-06-20 20:06:07 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
outputs = {
|
|
|
|
self,
|
|
|
|
nixpkgs,
|
|
|
|
nix-dart,
|
2024-11-14 16:45:03 +01:00
|
|
|
jmdict-src,
|
|
|
|
jmdict-with-examples-src,
|
|
|
|
radkfile-src,
|
|
|
|
kanjidic2-src
|
2022-06-20 20:06:07 +02:00
|
|
|
}: let
|
2024-11-14 16:45:03 +01:00
|
|
|
inherit (nixpkgs) lib;
|
|
|
|
systems = [
|
|
|
|
"x86_64-linux"
|
|
|
|
"aarch64-linux"
|
|
|
|
"x86_64-darwin"
|
|
|
|
"aarch64-darwin"
|
|
|
|
"armv7l-linux"
|
|
|
|
];
|
|
|
|
|
|
|
|
forAllSystems = f: lib.genAttrs systems (system: let
|
|
|
|
pkgs = import nixpkgs {
|
|
|
|
inherit system;
|
|
|
|
overlays = [
|
|
|
|
nix-dart.overlay
|
|
|
|
];
|
|
|
|
};
|
|
|
|
in f system pkgs);
|
2022-06-20 20:06:07 +02:00
|
|
|
in {
|
2024-11-14 16:45:03 +01:00
|
|
|
apps = forAllSystems (system: pkgs: {
|
|
|
|
default = let
|
|
|
|
inherit (self.packages.${system}) docs;
|
|
|
|
in {
|
|
|
|
type = "app";
|
|
|
|
program = "${pkgs.writeShellScript "host-docs" ''
|
|
|
|
${pkgs.python3} -m http.server -d ${docs}
|
|
|
|
''}";
|
|
|
|
};
|
|
|
|
});
|
|
|
|
|
|
|
|
devShells = forAllSystems (system: pkgs: {
|
|
|
|
default = pkgs.mkShell {
|
|
|
|
buildInputs = with pkgs; [
|
|
|
|
nix-dart.packages.${system}.pub2nix-lock
|
|
|
|
dart
|
|
|
|
gnumake
|
|
|
|
sqlite-interactive
|
|
|
|
sqlite-web
|
|
|
|
sqlint
|
|
|
|
sqlfluff
|
|
|
|
];
|
|
|
|
};
|
|
|
|
});
|
2022-06-20 20:06:07 +02:00
|
|
|
|
2024-11-14 16:45:03 +01:00
|
|
|
# defaultPackage.${system} = self.packages.${system}.database;
|
2022-06-20 20:06:07 +02:00
|
|
|
|
2024-11-14 16:45:03 +01:00
|
|
|
packages = let
|
2022-06-20 20:06:07 +02:00
|
|
|
edrdgMetadata = {
|
2024-11-14 16:45:03 +01:00
|
|
|
license = [{
|
2022-06-20 20:06:07 +02:00
|
|
|
shortName = "EDRDG";
|
|
|
|
fullName = "Electronic Dictionary Research and Development Group General Dictionary Licence";
|
|
|
|
url = "http://www.csse.monash.edu.au/~jwb/edrdg/licence.html";
|
2024-11-14 16:45:03 +01:00
|
|
|
}];
|
|
|
|
maintainers = [ lib.maintainers.h7x4 ];
|
2022-06-20 20:06:07 +02:00
|
|
|
platforms = lib.platforms.all;
|
|
|
|
};
|
|
|
|
|
2024-11-14 16:45:03 +01:00
|
|
|
src = lib.cleanSource ./.;
|
|
|
|
in forAllSystems (system: pkgs: {
|
|
|
|
default = self.packages.${system}.database;
|
2022-06-20 20:06:07 +02:00
|
|
|
|
2024-11-14 16:45:03 +01:00
|
|
|
jmdict = pkgs.callPackage ./nix/jmdict.nix {
|
|
|
|
inherit jmdict-src jmdict-with-examples-src edrdgMetadata;
|
2022-06-20 20:06:07 +02:00
|
|
|
};
|
|
|
|
|
2024-11-14 16:45:03 +01:00
|
|
|
radkfile = pkgs.callPackage ./nix/radkfile.nix {
|
|
|
|
inherit radkfile-src edrdgMetadata;
|
2022-06-20 20:06:07 +02:00
|
|
|
};
|
|
|
|
|
2024-11-14 16:45:03 +01:00
|
|
|
kanjidic2 = pkgs.callPackage ./nix/kanjidic2.nix {
|
|
|
|
inherit kanjidic2-src edrdgMetadata;
|
2022-08-18 21:39:36 +02:00
|
|
|
};
|
|
|
|
|
2024-11-14 16:45:03 +01:00
|
|
|
database-tool = pkgs.callPackage ./nix/database_tool.nix {
|
|
|
|
inherit nix-dart src;
|
2022-06-20 20:06:07 +02:00
|
|
|
};
|
|
|
|
|
2024-11-14 16:45:03 +01:00
|
|
|
database = pkgs.callPackage ./nix/database.nix {
|
|
|
|
inherit (self.packages.${system}) database-tool jmdict radkfile kanjidic2;
|
|
|
|
inherit src;
|
2022-06-20 20:06:07 +02:00
|
|
|
};
|
2022-08-23 18:13:58 +02:00
|
|
|
|
2024-11-14 16:45:03 +01:00
|
|
|
docs = pkgs.callPackage ./nix/docs.nix {
|
|
|
|
inherit (self.packages.${system}) database;
|
|
|
|
};
|
|
|
|
});
|
2022-06-20 20:06:07 +02:00
|
|
|
};
|
|
|
|
}
|