main
1{
2 python3,
3 lib,
4 makeWrapper,
5 fzf,
6 aria2,
7 wget,
8}:
9
10python3.pkgs.buildPythonApplication {
11 pname = "download-kiwix-zim";
12 version = "1.0.0";
13 format = "other";
14
15 src = ./.;
16
17 nativeBuildInputs = [ makeWrapper ];
18
19 # Runtime dependencies
20 buildInputs = [
21 fzf
22 aria2
23 wget
24 ];
25
26 installPhase = ''
27 runHook preInstall
28
29 mkdir -p $out/bin
30
31 # Install the script
32 cp download-kiwix-zim $out/bin/download-kiwix-zim
33 chmod +x $out/bin/download-kiwix-zim
34
35 # Wrap the script to ensure dependencies are in PATH
36 wrapProgram $out/bin/download-kiwix-zim \
37 --prefix PATH : ${
38 lib.makeBinPath [
39 fzf
40 aria2
41 wget
42 ]
43 }
44
45 runHook postInstall
46 '';
47
48 meta = {
49 description = "Browse and download ZIM files from the Kiwix library using fzf";
50 longDescription = ''
51 Interactive tool to browse the Kiwix catalog and download offline
52 content archives (ZIM files) for Wikipedia and other educational
53 resources. Features multi-select with fzf and parallel downloads
54 with aria2c.
55 '';
56 license = lib.licenses.mit;
57 platforms = lib.platforms.unix;
58 mainProgram = "download-kiwix-zim";
59 };
60}