aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/kobo/default.nix55
-rw-r--r--modules/lib/merge-files.nix3
2 files changed, 57 insertions, 1 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;
+ };
+ };
+ };
+}
diff --git a/modules/lib/merge-files.nix b/modules/lib/merge-files.nix
index c024e0c..fe0c651 100644
--- a/modules/lib/merge-files.nix
+++ b/modules/lib/merge-files.nix
@@ -1,8 +1,9 @@
{ runCommandLocal, rsync, lib, ... }:
files:
let
+ # ${lib.getExe rsync} -aL "${s.source}/" "$out${s.target}"
cpFile = s: ''
- ${lib.getExe rsync} -aL "${s.source}/" "$out${s.target}"
+ cp -a "${s.source}/" "$out${s.target}"
'';
in runCommandLocal "merged-files" {} ''
mkdir $out