nixeovim/modules/vim/opts.nix

27 lines
559 B
Nix
Raw Normal View History

2024-04-26 02:08:23 +03:00
{ config, lib, ... }:
2024-05-13 14:30:59 +03:00
let options = import ./options.nix { inherit lib; }; in
2024-04-26 02:08:23 +03:00
{
options.vim = with lib; with types; {
g = mkOption {
type = attrsOf (oneOf [ str bool number ]);
default = { };
2024-04-26 02:08:23 +03:00
};
2024-05-13 14:30:59 +03:00
opt = options.all;
2024-04-26 02:08:23 +03:00
# TODO: think more about vim.cmd
namedCmd = mkOption {
type = attrsOf str;
default = { };
};
cmd = mkOption {
type = str;
readOnly = true;
};
};
config = {
vim.cmd = lib.concatLines (lib.flip lib.mapAttrsToList config.vim.namedCmd (k: v: "\" ${k}\n${v}"));
};
}