aboutsummaryrefslogtreecommitdiff
path: root/modules/kobo/default.nix
diff options
context:
space:
mode:
authorChris Wells <chris@mathematicaster.org>2024-09-03 19:34:56 -0500
committerChris Wells <chris@mathematicaster.org>2024-09-03 19:34:56 -0500
commit1e9e6dbdd6edbfd8ac6249ba0d16e68b336cf093 (patch)
treea9e6528408f425d7d41ae4229bbd15f42bd94bd6 /modules/kobo/default.nix
parent849bdb056feb8e064396970f79c8962b20b0c07f (diff)
downloadkobo-manager-1e9e6dbdd6edbfd8ac6249ba0d16e68b336cf093.tar
kobo-manager-1e9e6dbdd6edbfd8ac6249ba0d16e68b336cf093.tar.gz
kobo-manager-1e9e6dbdd6edbfd8ac6249ba0d16e68b336cf093.tar.bz2
kobo-manager-1e9e6dbdd6edbfd8ac6249ba0d16e68b336cf093.tar.lz
kobo-manager-1e9e6dbdd6edbfd8ac6249ba0d16e68b336cf093.tar.xz
kobo-manager-1e9e6dbdd6edbfd8ac6249ba0d16e68b336cf093.tar.zst
kobo-manager-1e9e6dbdd6edbfd8ac6249ba0d16e68b336cf093.zip
Added different outpaths to separate KoboRoot, png and other files
Diffstat (limited to 'modules/kobo/default.nix')
-rw-r--r--modules/kobo/default.nix55
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;
+ };
+ };
+ };
+}