nix: add plugin_path

This commit is contained in:
DashieTM 2024-05-30 21:03:46 +02:00
parent 3a31a4ce3b
commit 1df2c3a369

View file

@ -36,7 +36,7 @@ in
plugin_config = mkOption { plugin_config = mkOption {
# TODO: define type # TODO: define type
# type = with types; nullOr (listOf toml); # type = with types; nullOr (listOf toml);
default = {}; default = { };
description = mdDoc '' description = mdDoc ''
Toml values passed to the configuration for plugins to use. Toml values passed to the configuration for plugins to use.
''; '';
@ -56,6 +56,11 @@ in
then "${entry}/lib/lib${entry.pname}.so" then "${entry}/lib/lib${entry.pname}.so"
else "") else "")
cfg.config.plugins; cfg.config.plugins;
path =
if cfg.config.plugins == null
then ""
else
"${lib.lists.last cfg.config.plugins}/lib";
in in
lib.mkIf cfg.enable { lib.mkIf cfg.enable {
home.packages = lib.optional (cfg.package != null) cfg.package; home.packages = lib.optional (cfg.package != null) cfg.package;
@ -63,6 +68,7 @@ in
xdg.configFile."reset/ReSet.toml".source = (pkgs.formats.toml { }).generate "reset" xdg.configFile."reset/ReSet.toml".source = (pkgs.formats.toml { }).generate "reset"
{ {
plugins = fetchedPlugins; plugins = fetchedPlugins;
} ;#++ (pkgs.formats.toml cfg.config.plugin_config); plugin_path = path;
}; #++ (pkgs.formats.toml cfg.config.plugin_config);
}; };
} }