modules/fn: use content instead of settings
move content to content.extra
This commit is contained in:
parent
238e4bf68e
commit
688e8e2ece
2 changed files with 9 additions and 7 deletions
|
@ -9,12 +9,14 @@ let
|
|||
default = [ ];
|
||||
};
|
||||
content = mkOption {
|
||||
type = with types; nullOr attrs;
|
||||
default = null;
|
||||
};
|
||||
settings = mkOption {
|
||||
type = types.functionTo (lib.types.submoduleWith {
|
||||
modules = [
|
||||
{
|
||||
options.extra = with lib; mkOption {
|
||||
type = with types; nullOr attrs;
|
||||
default = null;
|
||||
};
|
||||
}
|
||||
./vim/keymap.nix
|
||||
# ./vim/opts.nix
|
||||
];
|
||||
|
@ -34,10 +36,10 @@ let
|
|||
lambda = with lib.nix2lua;
|
||||
let
|
||||
fnArgs = builtins.listToAttrs (map (v: { name = v; value = raw v; }) config.args);
|
||||
innerCfg = config.settings fnArgs;
|
||||
innerCfg = config.content fnArgs;
|
||||
in
|
||||
lambda config.args (lib.flatten [
|
||||
config.content
|
||||
innerCfg.extra
|
||||
|
||||
(lib.flip map innerCfg.vim.keymap.set ({ mode, lhs, rhs, ... } @ vars:
|
||||
let
|
||||
|
|
|
@ -21,7 +21,7 @@ let cfg = config.plugins.gitsigns; in
|
|||
config = lib.mkIf cfg.enable {
|
||||
fn.gitsigns-nvim-on-attach = {
|
||||
args = [ "bufnr" ];
|
||||
settings = { bufnr }: {
|
||||
content = { bufnr }: {
|
||||
vim.keymap.set = map (attrs: attrs // { buffer = bufnr; }) cfg.keymap.set;
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue