26 lines
559 B
Nix
26 lines
559 B
Nix
{ config, lib, ... }:
|
|
|
|
let options = import ./options.nix { inherit lib; }; in
|
|
{
|
|
options.vim = with lib; with types; {
|
|
g = mkOption {
|
|
type = attrsOf (oneOf [ str bool number ]);
|
|
default = { };
|
|
};
|
|
opt = options.all;
|
|
|
|
# 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}"));
|
|
};
|
|
}
|