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 = [ ];
|
default = [ ];
|
||||||
};
|
};
|
||||||
content = mkOption {
|
content = mkOption {
|
||||||
type = with types; nullOr attrs;
|
|
||||||
default = null;
|
|
||||||
};
|
|
||||||
settings = mkOption {
|
|
||||||
type = types.functionTo (lib.types.submoduleWith {
|
type = types.functionTo (lib.types.submoduleWith {
|
||||||
modules = [
|
modules = [
|
||||||
|
{
|
||||||
|
options.extra = with lib; mkOption {
|
||||||
|
type = with types; nullOr attrs;
|
||||||
|
default = null;
|
||||||
|
};
|
||||||
|
}
|
||||||
./vim/keymap.nix
|
./vim/keymap.nix
|
||||||
# ./vim/opts.nix
|
# ./vim/opts.nix
|
||||||
];
|
];
|
||||||
|
@ -34,10 +36,10 @@ let
|
||||||
lambda = with lib.nix2lua;
|
lambda = with lib.nix2lua;
|
||||||
let
|
let
|
||||||
fnArgs = builtins.listToAttrs (map (v: { name = v; value = raw v; }) config.args);
|
fnArgs = builtins.listToAttrs (map (v: { name = v; value = raw v; }) config.args);
|
||||||
innerCfg = config.settings fnArgs;
|
innerCfg = config.content fnArgs;
|
||||||
in
|
in
|
||||||
lambda config.args (lib.flatten [
|
lambda config.args (lib.flatten [
|
||||||
config.content
|
innerCfg.extra
|
||||||
|
|
||||||
(lib.flip map innerCfg.vim.keymap.set ({ mode, lhs, rhs, ... } @ vars:
|
(lib.flip map innerCfg.vim.keymap.set ({ mode, lhs, rhs, ... } @ vars:
|
||||||
let
|
let
|
||||||
|
|
|
@ -21,7 +21,7 @@ let cfg = config.plugins.gitsigns; in
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
fn.gitsigns-nvim-on-attach = {
|
fn.gitsigns-nvim-on-attach = {
|
||||||
args = [ "bufnr" ];
|
args = [ "bufnr" ];
|
||||||
settings = { bufnr }: {
|
content = { bufnr }: {
|
||||||
vim.keymap.set = map (attrs: attrs // { buffer = bufnr; }) cfg.keymap.set;
|
vim.keymap.set = map (attrs: attrs // { buffer = bufnr; }) cfg.keymap.set;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue