{ lib, config, pkgs, ... }: lib.mkIf (lib.elem "nvim::hurl" config.machine.services) { programs.nvim-lazy.lazyPlugins = [ { lazy = true; dir = vPlug: vPlug.nui-nvim; } { lazy = true; ft = [ "hurl" ]; dir = vPlug: vPlug.hurl-nvim; dependencies = ( vPlug: with vPlug; [ "nvim-treesitter" nui-nvim plenary-nvim ] ++ (lib.optional (lib.elem "nvim::render-markdown-nvim" config.machine.services) vPlug.render-markdown-nvim) ); opts = { debug = false; show_notification = false; # Show response in popup or split mode = "popup"; formatters = { json = [ "${pkgs.jq}/bin/jq" ]; html = [ "${pkgs.nodePackages.prettier}/bin/prettier" "--parser" "html" ]; xml = [ "${pkgs.html-tidy}/bin/tidy" "-xml" "-i" "-q" ]; }; }; keys = [ { bind = "A"; cmd = "HurlRunner"; opts = { ft = "hurl"; desc = "Run All requests"; }; } { bind = "a"; cmd = "HurlRunnerAt"; opts = { ft = "hurl"; desc = "Run Api request"; }; } { bind = "te"; cmd = "HurlRunnerToEntry"; opts = { ft = "hurl"; desc = "Run Api request to entry"; }; } { bind = "tE"; cmd = "HurlRunnerToEnd"; opts = { ft = "hurl"; desc = "Run Api request from current entry to end"; }; } { bind = "tm"; cmd = "HurlToggleMode"; opts = { ft = "hurl"; desc = "Hurl Toggle Mode"; }; } { bind = "tv"; cmd = "HurlVerbose"; opts = { ft = "hurl"; desc = "Run Api in verbose mode"; }; } { bind = "tV"; cmd = "HurlVeryVerbose"; opts = { ft = "hurl"; desc = "Run Api in very verbose mode"; }; } { bind = "h"; cmd = ":HurlRunner"; opts = { ft = "hurl"; desc = "Hurl Runner"; mode = "v"; }; } ]; } ]; environment.systemPackages = with pkgs; [ hurl ]; }