summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wells <chris@mathematicaster.org>2026-10-28 17:42:00 -0400
committerChris Wells <chris@mathematicaster.org>2026-10-28 17:42:00 -0400
commitfa6302b58e11680e8ef36d0def6acb179393c0bc (patch)
treefb3a9e66dc5065cdfce6f50652f9e2f428fd384e
parentb87ced9a95fd0de4e3631e67cc5a7a929adee464 (diff)
downloadko-manager-master.tar
ko-manager-master.tar.gz
ko-manager-master.tar.bz2
ko-manager-master.tar.lz
ko-manager-master.tar.xz
ko-manager-master.tar.zst
ko-manager-master.zip
Seems to be workingHEADmaster
-rw-r--r--flake.nix5
-rw-r--r--instances/pocketbook.nix19
-rw-r--r--modules/files.nix2
-rw-r--r--modules/main.nix28
-rw-r--r--pkgs/kobo.nix2
-rw-r--r--pkgs/pocketbook.nix2
6 files changed, 47 insertions, 11 deletions
diff --git a/flake.nix b/flake.nix
index ebd0c77..04a6e69 100644
--- a/flake.nix
+++ b/flake.nix
@@ -50,6 +50,11 @@
koreader = {
pocketbook = ./instances/pocketbook.nix;
};
+
+ packages = {
+ ko-pocketbook = pkgs.callPackage ./pkgs/pocketbook.nix { };
+ ko-kobo = pkgs.callPackage ./pkgs/kobo.nix { };
+ };
};
};
}
diff --git a/instances/pocketbook.nix b/instances/pocketbook.nix
index 9d4af86..447292a 100644
--- a/instances/pocketbook.nix
+++ b/instances/pocketbook.nix
@@ -8,11 +8,17 @@ with builtins // lib;
let
pocketbooksync = pkgs.fetchzip {
url = "https://github.com/ckilb/pocketbooksync.koplugin/releases/download/v1.0.2/pocketbooksync.koplugin-v1.0.2.zip";
+ hash = "sha256-Up6tYirqiWLsTpUQhbxf9+rvC3SqBoVAck1m2qo2AB4=";
+ };
+ coverprogresspocketbook = pkgs.fetchzip {
+ url = "https://github.com/apastuszak/coverprogresspocketbook.koplugin/releases/download/v1.21/coverprogresspocketbook.koplugin.zip";
+ hash = "sha256-OuAwBCY2B6E9vPwqPWNPXllqyralAlQOSvCLRjfcwAI=";
};
wifi = pkgs.fetchFromGitHub {
owner = "Lomig";
repo = "koreader-pocketbook-wifi";
rev = "1278fe9";
+ hash = "sha256-foQ6tqrSWuRCd97cc1jr+Md7rVQH9pkfgGM3V2y0a5k=";
};
in
@@ -20,26 +26,21 @@ in
koreader.flavor = "pocketbook";
plugins = {
- pocketbooksync = "${pocketbooksync}/pocketbooksync.koplugin";
+ inherit pocketbooksync;
};
- # patches = {
- # "2-bookorbit-wifi-cycle.lua" = "${wifi}/patches/2-bookorbit-wifi-cycle.lua";
- # "2-menu-footer-wifi-icon.lua" = "${wifi}/patches/2-menu-footer-wifi-icon.lua";
- # "2-pocketbook-net-diag.lua" = "${wifi}/patches/2-pocketbook-net-diag.lua";
- # "2-pocketbook-wifi-off.lua" = "${wifi}/pathces/2-pocketbook-wifi-off.lua";
- # "2-pocketbook-wifi-silent-connect.lua" = "${wifi}/patches/2-pocketbook-wifi-silent-connect.lua";
- # };
patchDirectories = [
"${wifi}/patches"
];
dictionaries = {
- Wiktionary = pkgs.fetchtar {
+ Wiktionary = fetchTarball {
url = "https://github.com/xxyzz/wiktionary_stardict/releases/download/20261020/en-en.tar.zst";
+ sha256 = "sha256-dA/7ARC1S9drNUmwHdvYflj1q/k48TQlu3HfEQbVQJc=";
};
GNU = pkgs.fetchzip {
url = "http://tovotu.de/data/stardict/gcide.zip";
+ hash = "sha256-/HKqAaM5KCj8jYoYLl+1a4qQb3xK4DUB9rl/Xe9Sb9Y=";
};
};
diff --git a/modules/files.nix b/modules/files.nix
index 14b5319..c5256a0 100644
--- a/modules/files.nix
+++ b/modules/files.nix
@@ -30,7 +30,7 @@ with builtins // lib;
};
text = mkOption {
type = types.lines;
- default = null;
+ default = "";
};
};
diff --git a/modules/main.nix b/modules/main.nix
index 974f599..cd5262a 100644
--- a/modules/main.nix
+++ b/modules/main.nix
@@ -36,9 +36,35 @@ with builtins // lib;
RSYNC="rsync -a --copy-links -v"
$RSYNC "${config.koreader.basePackage}/" "$out/"
- $RSYNC "${config._files}/" "$out/${config.koreaderPath}/"
+ $RSYNC "${config._files}/" "$out/${config.koreader.koreaderPath}/"
'';
};
+ finalPackageTar = mkOption {
+ type = types.path;
+ readOnly = true;
+ default = pkgs.runCommandLocal "tar" { nativeBuildInputs = [ pkgs.tar ]; } ''
+ cd "${config.koreader.finalPackage}"
+ tar cvf "$out" .
+ '';
+ };
+ deploy = mkOption {
+ type = types.package;
+ readOnly = true;
+ default = pkgs.writeShellApplication {
+ name = "deploy";
+ runtimeInputs = [ pkgs.tar ];
+ text = ''
+ DESTINATION="''${1-}"
+
+ if [ -z "$DESTINATION" ]; then
+ echo "Must include a destination"
+ exit 1
+ fi
+
+ tar xvf "${config.koreader.finalPackageTar}" --directory "$DESTINATION"
+ '';
+ };
+ };
};
};
diff --git a/pkgs/kobo.nix b/pkgs/kobo.nix
index 4f8438c..54463fd 100644
--- a/pkgs/kobo.nix
+++ b/pkgs/kobo.nix
@@ -1,4 +1,6 @@
{ fetchzip }:
fetchzip {
url = "https://storage.gra.cloud.ovh.net/v1/AUTH_2ac4bfee353948ec8ea7fd1710574097/kfmon-pub/OCP-KOReader-v2026.03.zip";
+ stripRoot = false;
+ hash = "sha256-HZkpTrdfYhklxGkbCr9+NqMDWsUlDMR5hQ5TTZ0XALg=";
}
diff --git a/pkgs/pocketbook.nix b/pkgs/pocketbook.nix
index 4cbeadf..2b253ab 100644
--- a/pkgs/pocketbook.nix
+++ b/pkgs/pocketbook.nix
@@ -4,4 +4,6 @@ let
in
fetchzip {
url = "https://github.com/koreader/koreader/releases/download/v${version}/koreader-pocketbook-v${version}.zip";
+ stripRoot = false;
+ hash = "sha256-L6FXRfMd4YAQix49HmLDOLbcYZHUfmhRTDyLiM1ff5g=";
}