Skip to content

Commit

Permalink
feat: allow mkLuaInline in plugin config
Browse files Browse the repository at this point in the history
  • Loading branch information
nekowinston committed Mar 12, 2024
1 parent 8c7a0d7 commit cf4479c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions modules/plugins/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
}:
with lib; let
inherit (flake-parts-lib) mkPerSystemOption;
isLuaInline = e: isAttrs e && matchAttrs {_type = "lua-inline";} e;
pluginSpec = with types; {
options = {
src = mkOption {
Expand Down Expand Up @@ -155,13 +156,13 @@ in {
// optionalAttrs (isDerivation attrs.init || isPath attrs.init) {
init = lib.generators.mkLuaInline ''dofile "${attrs.init}"'';
}
// optionalAttrs (isBool attrs.config) {
// optionalAttrs (isBool attrs.config || isLuaInline attrs.config) {
inherit (attrs) config;
}
// optionalAttrs (isDerivation attrs.config || isPath attrs.config) {
config = lib.generators.mkLuaInline ''dofile "${attrs.config}"'';
}
// optionalAttrs (builtins.isAttrs attrs.config) {
// optionalAttrs (lib.isAttrs attrs.config && !(isLuaInline attrs.config)) {
config = true;
opts = attrs.config;
}
Expand Down

0 comments on commit cf4479c

Please sign in to comment.