aboutsummaryrefslogtreecommitdiff
path: root/modules/koreader.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/koreader.nix')
-rw-r--r--modules/koreader.nix28
1 files changed, 16 insertions, 12 deletions
diff --git a/modules/koreader.nix b/modules/koreader.nix
index 0a7300a..aec90fe 100644
--- a/modules/koreader.nix
+++ b/modules/koreader.nix
@@ -2,6 +2,7 @@
with builtins // lib;
let
cfg = config.koreader;
+ importOption = p: (import p { inherit pkgs lib; } cfg.path).option;
in {
options.koreader = {
enable = mkEnableOption "KOReader";
@@ -14,22 +15,25 @@ in {
nickelEntry = mkEnableOption "Launch KOReader directly via nickelMenu";
- file = mkOption {
- type = options.file.type;
- default = {};
- description = "Files relative to ${cfg.path}";
- };
+ file = importOption ./lib/file.nix;
+ manifest = importOption ./lib/manifest.nix;
+
+ # file = mkOption {
+ # type = options.file.type;
+ # default = {};
+ # description = "Files relative to ${cfg.path}";
+ # };
};
config = mkIf cfg.enable {
- file = mapAttrs' (n: v: {
- name = "koreader-${n}";
- value = v // {
- target = "${cfg.path}/${v.target}";
- };
- }) cfg.file
+ # file = mapAttrs' (n: v: {
+ # name = "koreader-${n}";
+ # value = v // {
+ # target = "${cfg.path}/${v.target}";
+ # };
+ # }) cfg.file;
- nickel.menu.items = mkIf cfg.nickelEntry {
+ nickel.menu.item = mkIf cfg.nickelEntry {
koreader = singleton {
location = "main";
label = "KOReader";