mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-06 18:31:35 +00:00
modules: make lib calls explicit where possible
This commit is contained in:
parent
bf1118eb28
commit
024e1a6845
41 changed files with 245 additions and 203 deletions
|
@ -1,4 +1,4 @@
|
|||
_: {
|
||||
{
|
||||
imports = [
|
||||
./nvim-dap
|
||||
];
|
||||
|
|
|
@ -3,12 +3,14 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) addDescriptionsToMappings mkMerge mkIf mapAttrs nvim mkSetLuaBinding optionalString;
|
||||
inherit (lib.strings) optionalString;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.attrsets) mapAttrs;
|
||||
inherit (lib.nvim.binds) addDescriptionsToMappings mkSetLuaBinding;
|
||||
inherit (lib.nvim.dag) entryAnywhere entryAfter;
|
||||
|
||||
cfg = config.vim.debugger.nvim-dap;
|
||||
self = import ./nvim-dap.nix {
|
||||
inherit lib;
|
||||
};
|
||||
self = import ./nvim-dap.nix {inherit lib;};
|
||||
mappingDefinitions = self.options.vim.debugger.nvim-dap.mappings;
|
||||
mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions;
|
||||
in {
|
||||
|
@ -19,12 +21,12 @@ in {
|
|||
vim.luaConfigRC =
|
||||
{
|
||||
# TODO customizable keymaps
|
||||
nvim-dap = nvim.dag.entryAnywhere ''
|
||||
nvim-dap = entryAnywhere ''
|
||||
local dap = require("dap")
|
||||
vim.fn.sign_define("DapBreakpoint", { text = "🛑", texthl = "ErrorMsg", linehl = "", numhl = "" })
|
||||
'';
|
||||
}
|
||||
// mapAttrs (_: v: (nvim.dag.entryAfter ["nvim-dap"] v)) cfg.sources;
|
||||
// mapAttrs (_: v: (entryAfter ["nvim-dap"] v)) cfg.sources;
|
||||
|
||||
vim.maps.normal = mkMerge [
|
||||
(mkSetLuaBinding mappings.continue "require('dap').continue")
|
||||
|
@ -49,7 +51,7 @@ in {
|
|||
(mkIf (cfg.enable && cfg.ui.enable) {
|
||||
vim.startPlugins = ["nvim-dap-ui"];
|
||||
|
||||
vim.luaConfigRC.nvim-dap-ui = nvim.dag.entryAfter ["nvim-dap"] (''
|
||||
vim.luaConfigRC.nvim-dap-ui = entryAfter ["nvim-dap"] (''
|
||||
local dapui = require("dapui")
|
||||
dapui.setup()
|
||||
''
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
_: {
|
||||
{
|
||||
imports = [
|
||||
./config.nix
|
||||
./nvim-dap.nix
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib) mkEnableOption mkOption types mkMappingOption;
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.types) bool attrsOf str;
|
||||
inherit (lib.nvim.binds) mkMappingOption;
|
||||
in {
|
||||
options.vim.debugger.nvim-dap = {
|
||||
enable = mkEnableOption "debugging via nvim-dap";
|
||||
|
@ -7,7 +9,7 @@ in {
|
|||
ui = {
|
||||
enable = mkEnableOption "UI extension for nvim-dap";
|
||||
autoStart = mkOption {
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
default = true;
|
||||
description = "Automatically Opens and Closes DAP-UI upon starting/closing a debugging session";
|
||||
};
|
||||
|
@ -16,7 +18,7 @@ in {
|
|||
sources = mkOption {
|
||||
default = {};
|
||||
description = "List of debuggers to install";
|
||||
type = with types; attrsOf str;
|
||||
type = attrsOf str;
|
||||
};
|
||||
|
||||
mappings = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue