diff options
| author | Chris Wells <chris@mathematicaster.org> | 2024-02-15 15:41:07 -0600 |
|---|---|---|
| committer | Chris Wells <chris@mathematicaster.org> | 2024-02-15 15:41:07 -0600 |
| commit | d7483ed8505710033384d7fabad34470818bc760 (patch) | |
| tree | 8411a63b83e8d4ee994d0ce51426ba9a6e61043a | |
| parent | cbde891d1ced129f6284cbadade652182aa5d2fb (diff) | |
| download | kobo-manager-d7483ed8505710033384d7fabad34470818bc760.tar kobo-manager-d7483ed8505710033384d7fabad34470818bc760.tar.gz kobo-manager-d7483ed8505710033384d7fabad34470818bc760.tar.bz2 kobo-manager-d7483ed8505710033384d7fabad34470818bc760.tar.lz kobo-manager-d7483ed8505710033384d7fabad34470818bc760.tar.xz kobo-manager-d7483ed8505710033384d7fabad34470818bc760.tar.zst kobo-manager-d7483ed8505710033384d7fabad34470818bc760.zip | |
Added dev path. Now to figure out how to make my own one-click packages
| -rw-r--r-- | modules/kfmon.nix | 31 | ||||
| -rw-r--r-- | modules/kobo.nix | 7 | ||||
| -rw-r--r-- | modules/koreader.nix | 9 | ||||
| -rw-r--r-- | modules/nickel.nix | 12 | ||||
| -rw-r--r-- | modules/plato.nix | 11 |
5 files changed, 57 insertions, 13 deletions
diff --git a/modules/kfmon.nix b/modules/kfmon.nix index 33f6a9c..adb53bd 100644 --- a/modules/kfmon.nix +++ b/modules/kfmon.nix @@ -2,7 +2,10 @@ with builtins // lib; let cfg = config.kfmon; + ini = pkgs.formats.ini {}; importOption = p: (import p { inherit pkgs lib; } cfg.path).option; + + addSuffix = s: p: if hasSuffix s p then p else p + s; in { options.kfmon = { enable = mkEnableOption "KFMon"; @@ -13,13 +16,31 @@ in { description = "Relative path to kfmon within src"; }; + devPath = mkOption { + type = types.str; + default = "/mnt/onboard/${cfg.path}"; + readOnly = true; + internal = true; + }; + file = importOption ./lib/file.nix; manifest = importOption ./lib/manifest.nix; - # file = mkOption { - # type = options.file.type; - # default = {}; - # description = "Files relative to ${cfg.path}"; - # }; + + configs = mkOption { + type = types.attrsOf ini.type + default = {}; + description = '' + KFMon .ini config files. Do not touch this unless you know what you're doing! + ''; + }; }; + config.kfmon.file = mapAttrs' (n: v: { + name = addSuffix ".ini" n; + value = { + target = "config/${addSuffix ".ini" n}"; + text = generators.toINI {} v; + }; + }) cfg.configs; + } diff --git a/modules/kobo.nix b/modules/kobo.nix index 57f7a88..1b59a21 100644 --- a/modules/kobo.nix +++ b/modules/kobo.nix @@ -14,6 +14,13 @@ in { description = "Relative path to main Kobo config"; }; + devPath = mkOption { + type = types.str; + default = "/mnt/onboard/${cfg.path}" + readOnly = true; + internal = true; + }; + file = importOption ./lib/file.nix; manifest = importOption ./lib/manifest.nix; diff --git a/modules/koreader.nix b/modules/koreader.nix index aec90fe..5bcca42 100644 --- a/modules/koreader.nix +++ b/modules/koreader.nix @@ -13,6 +13,13 @@ in { description = "Relative path to KOReader within src"; }; + devPath = mkOption { + type = types.str; + default = "/mnt/onboard/${cfg.path}"; + readOnly = true; + internal = true; + }; + nickelEntry = mkEnableOption "Launch KOReader directly via nickelMenu"; file = importOption ./lib/file.nix; @@ -40,7 +47,7 @@ in { action = "cmd_spawn"; arg = [ "quiet" - "exec /mnt/onboard/${cfg.path}/koreader.sh" + "exec ${cfg.devPath}/koreader.sh" ]; }; }; diff --git a/modules/nickel.nix b/modules/nickel.nix index 4d22c70..cfba224 100644 --- a/modules/nickel.nix +++ b/modules/nickel.nix @@ -58,13 +58,15 @@ in { description = "Relative path to nickelMenu within src"; }; + devPath = mkOption { + type = types.str; + default = "/mnt/onboard/${cfg.path}"; + readOnly = true; + internal = true; + }; + file = importOption ./lib/file.nix; manifest = importOption ./lib/manifest.nix; - # file = mkOption { - # type = options.file.type; - # default = {}; - # description = "Files relative to ${cfg.path}"; - # }; menu = { item = mkOption { diff --git a/modules/plato.nix b/modules/plato.nix index 2fb1016..0d0d05d 100644 --- a/modules/plato.nix +++ b/modules/plato.nix @@ -13,11 +13,18 @@ in { enable = mkEnableOption "Plato"; path = mkOption { - type = types.srt; + type = types.str; default = ".adds/plato"; description = "Relative path to Plato within src"; }; + devPath = mkOption { + type = types.str; + default = "/mnt/onboard/${cfg.path}"; + readOnly = true; + internal = true; + }; + file = importOption ./lib/file.nix; manifest = importOption ./lib/manifest.nix; @@ -194,7 +201,7 @@ in { action = "cmd_spawn"; arg = [ "quiet" - "exec /mnt/onboard/${cfg.path}/plato.sh" + "exec ${cfg.devPath}/plato.sh" ]; }; }; |
