Nixfiles/neovim/modules/commands.nix

19 lines
392 B
Nix
Raw Normal View History

2024-05-13 22:45:35 +02:00
{ lib, config, ... }:
with lib;
2024-03-11 12:20:53 +01:00
{
options = {
commands = mkOption {
type = types.attrsOf types.str;
2024-05-13 22:45:35 +02:00
default = { };
2024-03-11 12:20:53 +01:00
description = "Extra commands to be created";
};
};
2024-05-13 22:45:35 +02:00
config.extraConfigVim =
let
commands =
cmds: concatStringsSep "\n" (map (cmd: "command ${cmd} ${getAttr cmd cmds}") (attrNames cmds));
in
2024-03-11 12:20:53 +01:00
commands config.commands;
}