From cbde891d1ced129f6284cbadade652182aa5d2fb Mon Sep 17 00:00:00 2001 From: Chris Wells Date: Wed, 14 Feb 2024 15:13:20 -0600 Subject: Fixing my earlier mistakes --- modules/plato.nix | 58 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 31 insertions(+), 27 deletions(-) (limited to 'modules/plato.nix') 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 { -- cgit v1.2.3