aboutsummaryrefslogtreecommitdiff
path: root/modules/plato.nix
diff options
context:
space:
mode:
authorChris Wells <chris@mathematicaster.org>2024-02-14 15:13:20 -0600
committerChris Wells <chris@mathematicaster.org>2024-02-14 15:13:20 -0600
commitcbde891d1ced129f6284cbadade652182aa5d2fb (patch)
tree8c09770b3e4082dd3d205695e3d1827daba14ffc /modules/plato.nix
parent51ae706e6c007cdda2ebb8317c1d438dff9ed570 (diff)
downloadkobo-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/plato.nix')
-rw-r--r--modules/plato.nix58
1 files changed, 31 insertions, 27 deletions
diff --git a/modules/plato.nix b/modules/plato.nix
index f274f00..2fb1016 100644
--- a/modules/plato.nix
+++ b/modules/plato.nix
@@ -3,13 +3,14 @@ with builtins // lib;
let
cfg = config.plato;
toml = pkgs.formats.toml {};
+ importOption = p: (import p { inherit pkgs lib; } cfg.path).option;
in {
imports = [
./nickel.nix
];
options.plato = {
- enable = mkEnableOpiton "Plato";
+ enable = mkEnableOption "Plato";
path = mkOption {
type = types.srt;
@@ -17,17 +18,20 @@ in {
description = "Relative path to Plato within src";
};
- file = mkOption {
- type = options.file.type;
- default = {};
- description = "Files relative to ${cfg.path}";
- };
+ file = importOption ./lib/file.nix;
+ manifest = importOption ./lib/manifest.nix;
- manifest = mkOption {
- type = options.manifest.type;
- default = {};
- description = "Manifest relative to ${cfg.path}";
- };
+ # 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}";
+ # };
nickelEntry = mkEnableOption "Launch Plato directly from nickelMenu";
@@ -138,7 +142,7 @@ in {
name = if hasSuffix ".css" n1 then n1 else "{n1}.css";
in {
inherit name;
- value = { inherit text; }
+ value = { inherit text; };
}) cfg.css)
(mapAttrs' (n: t:
@@ -153,11 +157,11 @@ in {
{
dictionaries = {
- directory = true;
+ # directory = true;
source = cfg.allDictionaries;
};
fonts = {
- directory = true;
+ # directory = true;
source = cfg.allFonts;
};
}
@@ -169,19 +173,19 @@ in {
};
};
- file = mapAttrs' (n: v: {
- name = "plato-${n}";
- value = v // {
- target = "${cfg.path}/${v.target}";
- };
- }) cfg.file;
-
- manifest = mapAttrs' (n: v: {
- name = "plato-${n}";
- value = v // {
- targets = map (x: "${cfg.path}/${x}") v.targets;
- };
- }) cfg.manifest;
+ # file = mapAttrs' (n: v: {
+ # name = "plato-${n}";
+ # value = v // {
+ # target = "${cfg.path}/${v.target}";
+ # };
+ # }) cfg.file;
+
+ # manifest = mapAttrs' (n: v: {
+ # name = "plato-${n}";
+ # value = v // {
+ # targets = map (x: "${cfg.path}/${x}") v.targets;
+ # };
+ # }) cfg.manifest;
nickel.menu.item = mkIf cfg.nickelEntry {
plato = singleton {