mirror of
https://github.com/Xetibo/ReSet.git
synced 2025-04-12 08:28:32 +02:00
nix: add plugin entry
This commit is contained in:
parent
ecfaf2badd
commit
f5d0eae840
|
@ -1 +1 @@
|
||||||
flake-profile-2-link
|
flake-profile-1-link
|
43
nix/hm.nix
43
nix/hm.nix
|
@ -23,8 +23,45 @@ in
|
||||||
Package to run
|
Package to run
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
plugins = mkOption {
|
||||||
|
type = with types; nullOr (listOf package);
|
||||||
|
default = null;
|
||||||
|
description = mdDoc ''
|
||||||
|
List of plugins to use, represented as a list of packages.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
plugin_config = mkOption {
|
||||||
|
type = with types; nullOr (listOf toml);
|
||||||
|
default = null;
|
||||||
|
description = mdDoc ''
|
||||||
|
Toml values passed to the configuration for plugins to use.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
config = lib.mkIf cfg.enable {
|
config =
|
||||||
home.packages = lib.optional (cfg.package != null) cfg.package;
|
let
|
||||||
};
|
fetchedPlugins =
|
||||||
|
if cfg.config.plugins == null
|
||||||
|
then [ ]
|
||||||
|
else
|
||||||
|
builtins.map
|
||||||
|
(entry:
|
||||||
|
if lib.types.package.check entry
|
||||||
|
then "${entry}/lib/lib${entry.pname}.so"
|
||||||
|
else "")
|
||||||
|
cfg.config.plugins;
|
||||||
|
in
|
||||||
|
lib.mkIf cfg.enable {
|
||||||
|
home.packages = lib.optional (cfg.package != null) cfg.package;
|
||||||
|
|
||||||
|
xdg.configFile."reset/ReSet.toml".source = (pkgs.formats.toml { }).generate "reset"
|
||||||
|
{
|
||||||
|
plugins = fetchedPlugins;
|
||||||
|
} ++ cfg.config.plugin_config;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue