Nixfiles/neovim/modules/commands.nix
2024-05-13 22:46:17 +02:00

18 lines
392 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;
}