diff options
| author | Chris Wells <chris@mathematicaster.org> | 2024-02-14 15:13:20 -0600 |
|---|---|---|
| committer | Chris Wells <chris@mathematicaster.org> | 2024-02-14 15:13:20 -0600 |
| commit | cbde891d1ced129f6284cbadade652182aa5d2fb (patch) | |
| tree | 8c09770b3e4082dd3d205695e3d1827daba14ffc /modules/kobo.nix | |
| parent | 51ae706e6c007cdda2ebb8317c1d438dff9ed570 (diff) | |
| download | kobo-manager-cbde891d1ced129f6284cbadade652182aa5d2fb.tar kobo-manager-cbde891d1ced129f6284cbadade652182aa5d2fb.tar.gz kobo-manager-cbde891d1ced129f6284cbadade652182aa5d2fb.tar.bz2 kobo-manager-cbde891d1ced129f6284cbadade652182aa5d2fb.tar.lz kobo-manager-cbde891d1ced129f6284cbadade652182aa5d2fb.tar.xz kobo-manager-cbde891d1ced129f6284cbadade652182aa5d2fb.tar.zst kobo-manager-cbde891d1ced129f6284cbadade652182aa5d2fb.zip | |
Fixing my earlier mistakes
Diffstat (limited to 'modules/kobo.nix')
| -rw-r--r-- | modules/kobo.nix | 53 |
1 files changed, 17 insertions, 36 deletions
diff --git a/modules/kobo.nix b/modules/kobo.nix index 229a5d1..57f7a88 100644 --- a/modules/kobo.nix +++ b/modules/kobo.nix @@ -3,6 +3,7 @@ with builtins // lib; let cfg = config.kobo; ini = pkgs.formats.ini {}; + importOption = p: (import p { inherit pkgs lib; } cfg.path).option; in { options.kobo = { enable = mkEnableOption "main configurations"; @@ -13,51 +14,30 @@ in { description = "Relative path to main Kobo config"; }; - file = mkOption { - type = options.file.type; - default = {}; - description = "Files relative to ${cfg.path}"; - }; - - manifest = mkOption { - type = options.manifest.type; - default = {}; - description = "Manifest relative to ${cfg.path}"; - }; + file = importOption ./lib/file.nix; + manifest = importOption ./lib/manifest.nix; config = mkOption { type = ini.type; default = {}; description = "https://wiki.mobileread.com/wiki/Kobo_Configuration_Options"; }; - - # src = mkOption { - # type = types.package; - # description = "The base source files to use"; - # default = with pkgs.kobo.src; - # if config.plato.enable && config.koreader.enable then KOReader-Plato - # else if config.plato.enable then Plato - # else if config.koreader.enable then KOReader - # else if config.kfmon.enable then KFMon - # else error "At least one of plato, koreader or kfmon must be enabled in order to use a default package"; - # }; - }; config = { - file = mapAttrs' (n: v: { - name = "kobo-${n}"; - value = v // { - target = "${cfg.path}/${v.target}"; - }; - }) cfg.file; + # file = mapAttrs' (n: v: { + # name = "kobo-${n}"; + # value = v // { + # target = "${cfg.path}/${v.target}"; + # }; + # }) cfg.file; - manifest = mapAttrs' (n: v: { - name = "kobo-${n}"; - value = v // { - targets = map (x: "${cfg.path}/${x}") v.targets; - }; - }) cfg.manifest; + # manifest = mapAttrs' (n: v: { + # name = "kobo-${n}"; + # value = v // { + # targets = map (x: "${cfg.path}/${x}") v.targets; + # }; + # }) cfg.manifest; kobo = { config = { @@ -82,4 +62,5 @@ in { }; - } + }; +} |
