{
  pkgs,
  lib,
  ...
}: {
  programs.nixvim = {
    # TODO: package debugprint though a module
    extraConfigLuaPost = ''
      ${lib.strings.fileContents ./lua/debugprint.lua}
    '';
    extraPlugins = [
      pkgs.vimExtraPlugins.debugprint-nvim
    ];

    maps = let
      visualNormal = {
        "g?v" = {
          action = ''
            function()
              return require('debugprint').debugprint({variable = true;});
            end
          '';
          lua = true;
          expr = true;
          desc = ''
            'variable' debug line below the current line
          '';
        };
        "g?V" = {
          action = ''
            function()
              return require('debugprint').debugprint({above = true; variable = true;}) ;
            end
          '';
          lua = true;
          expr = true;
          desc = ''
            'variable' debug line above the current line
          '';
        };
      };
    in {
      normal =
        {
          "g?p" = {
            action = ''
              function()
                return require('debugprint').debugprint();
              end
            '';
            lua = true;
            expr = true;
            desc = ''
              'plain' debug line below the current line
            '';
          };
          "g?P" = {
            action = ''
              function()
                return require('debugprint').debugprint({above = true;});
              end
            '';
            lua = true;
            expr = true;
            desc = ''
              'plain' debug line above the current line
            '';
          };
        }
        // visualNormal;
      visual =
        {
        }
        // visualNormal;
    };
  };
}