diff options
Diffstat (limited to 'modules/kobo/default.nix')
| -rw-r--r-- | modules/kobo/default.nix | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/modules/kobo/default.nix b/modules/kobo/default.nix new file mode 100644 index 0000000..29ed213 --- /dev/null +++ b/modules/kobo/default.nix @@ -0,0 +1,55 @@ +{ config, pkgs, lib, ... }: +with builtins // lib; +let + cfg = config.kobo; + ini = pkgs.formats.ini {}; +in { + options.kobo = { + enable = mkEnableOption "main configurations"; + + path = mkOption { + type = types.str; + readOnly = true; + internal = true; + default = ".kobo/Kobo"; + }; + + devicePath = mkOption { + type = types.str; + readOnly = true; + internal = true; + deafault = "/mnt/onboard/${cfg.path}"; + }; + + file = mkOption { + default = {}; + type = types.attrsOf (types.submodule (pkgs.callPackage ../lib/file-type.nix {})); + }; + + _allFiles = mkOption { + type = types.package; + readOnly = true; + internal = true; + default = (pkgs.callPackage ../lib/merge-files.nix {}) (attrValues cfg.file); + }; + + conf = mkOption { + type = ini.type; + default = {}; + description = "https://wiki.mobileread.com/wiki/Kobo_Configuration_Options"; + }; + }; + + config = { + kobo = { + conf = { + FeatureSettings.ExcludeSyncFolders = ''(\.(?!kobo|adobe).+|([^.][^/]*/)+\..+)''; + ApplicationPreferences.QuickTourShown = true; + }; + + file = mkIf (cfg.conf != {}) { + "Kobo eReader.conf".text = generators.toINI {} cfg.conf; + }; + }; + }; +} |
