Nixfiles/neovim/modules/commands.nix

20 lines
387 B
Nix

{
lib,
config,
...
}:
with lib; {
options = {
commands = mkOption {
type = types.attrsOf types.str;
default = {};
description = "Extra commands to be created";
};
};
config.extraConfigVim = let
commands = cmds:
concatStringsSep "\n" (map (cmd: "command ${cmd} ${getAttr cmd cmds}") (attrNames cmds));
in
commands config.commands;
}