File tree Expand file tree Collapse file tree 6 files changed +36
-24
lines changed Expand file tree Collapse file tree 6 files changed +36
-24
lines changed Original file line number Diff line number Diff line change 5
5
pkgs ,
6
6
...
7
7
} :
8
- with lib ;
9
8
let
9
+ inherit ( lib ) types ;
10
+
10
11
cfg = config . plugins . dap . extensions . dap-go ;
11
12
dapHelpers = import ./dapHelpers.nix { inherit lib helpers ; } ;
12
13
in
13
14
{
14
15
options . plugins . dap . extensions . dap-go = {
15
- enable = mkEnableOption "dap-go" ;
16
+ enable = lib . mkEnableOption "dap-go" ;
16
17
17
18
package = lib . mkPackageOption pkgs "dap-go" {
18
19
default = [
55
56
} ;
56
57
} ;
57
58
in
58
- mkIf cfg . enable {
59
+ lib . mkIf cfg . enable {
59
60
extraPlugins = [ cfg . package ] ;
60
61
61
62
plugins . dap = {
Original file line number Diff line number Diff line change 5
5
pkgs ,
6
6
...
7
7
} :
8
- with lib ;
9
8
let
9
+ inherit ( lib ) types ;
10
+
10
11
cfg = config . plugins . dap . extensions . dap-python ;
11
12
dapHelpers = import ./dapHelpers.nix { inherit lib helpers ; } ;
12
13
in
13
14
{
14
15
options . plugins . dap . extensions . dap-python = {
15
- enable = mkEnableOption "dap-python" ;
16
+ enable = lib . mkEnableOption "dap-python" ;
16
17
17
18
package = lib . mkPackageOption pkgs "dap-python" {
18
19
default = [
21
22
] ;
22
23
} ;
23
24
24
- adapterPythonPath = mkOption {
25
+ adapterPythonPath = lib . mkOption {
25
26
default = lib . getExe ( pkgs . python3 . withPackages ( ps : with ps ; [ debugpy ] ) ) ;
26
27
defaultText = lib . literalExpression ''
27
28
lib.getExe (pkgs.python3.withPackages (ps: with ps; [ debugpy ]))
67
68
include_configs = includeConfigs ;
68
69
} ;
69
70
in
70
- mkIf cfg . enable {
71
+ lib . mkIf cfg . enable {
71
72
extraPlugins = [ cfg . package ] ;
72
73
73
74
plugins . dap = {
Original file line number Diff line number Diff line change 5
5
pkgs ,
6
6
...
7
7
} :
8
- with lib ;
9
8
let
9
+ inherit ( lib ) mkOption types ;
10
+
10
11
cfg = config . plugins . dap . extensions . dap-ui ;
11
12
12
13
mkSizeOption = helpers . mkNullOrOption ( with types ; either int ( numbers . between 0.0 1.0 ) ) ;
13
14
14
15
mkKeymapOptions =
15
16
name :
16
- mapAttrs (
17
+ lib . mapAttrs (
17
18
key : default :
18
19
helpers . defaultNullOpts . mkNullable (
19
20
with types ; either str ( listOf str )
57
58
in
58
59
{
59
60
options . plugins . dap . extensions . dap-ui = lib . nixvim . plugins . neovim . extraOptionsOptions // {
60
- enable = mkEnableOption "dap-ui" ;
61
+ enable = lib . mkEnableOption "dap-ui" ;
61
62
62
63
package = lib . mkPackageOption pkgs "dap-ui" {
63
64
default = [
232
233
}
233
234
// cfg . extraOptions ;
234
235
in
235
- mkIf cfg . enable {
236
+ lib . mkIf cfg . enable {
236
237
extraPlugins = [ cfg . package ] ;
237
238
238
239
plugins . dap = {
Original file line number Diff line number Diff line change 5
5
pkgs ,
6
6
...
7
7
} :
8
- with lib ;
9
8
let
10
9
cfg = config . plugins . dap . extensions . dap-virtual-text ;
11
10
in
12
11
{
13
12
options . plugins . dap . extensions . dap-virtual-text = {
14
- enable = mkEnableOption "dap-virtual-text" ;
13
+ enable = lib . mkEnableOption "dap-virtual-text" ;
15
14
16
15
package = lib . mkPackageOption pkgs "dap-virtual-text" {
17
16
default = [
62
61
63
62
virtLines = helpers . defaultNullOpts . mkBool false "Show virtual lines instead of virtual text (will flicker!)." ;
64
63
65
- virtTextWinCol = helpers . mkNullOrOption types . int ''
64
+ virtTextWinCol = helpers . mkNullOrOption lib . types . int ''
66
65
Position the virtual text at a fixed window column (starting from the first text column).
67
66
See `:h nvim_buf_set_extmark()`.
68
67
'' ;
87
86
virt_text_win_col = virtTextWinCol ;
88
87
} ;
89
88
in
90
- mkIf cfg . enable {
89
+ lib . mkIf cfg . enable {
91
90
extraPlugins = [ cfg . package ] ;
92
91
93
92
plugins . dap = {
Original file line number Diff line number Diff line change 1
1
{ lib , helpers } :
2
- with lib ;
2
+ let
3
+ inherit ( lib ) types ;
4
+ in
3
5
rec {
4
6
mkAdapterType =
5
7
attrs :
@@ -92,12 +94,12 @@ rec {
92
94
freeformType = types . attrs ;
93
95
94
96
options = {
95
- type = mkOption {
97
+ type = lib . mkOption {
96
98
description = "Which debug adapter to use." ;
97
99
type = types . str ;
98
100
} ;
99
101
100
- request = mkOption {
102
+ request = lib . mkOption {
101
103
type = types . enum [
102
104
"attach"
103
105
"launch"
@@ -107,7 +109,7 @@ rec {
107
109
'' ;
108
110
} ;
109
111
110
- name = mkOption {
112
+ name = lib . mkOption {
111
113
type = types . str ;
112
114
description = "A user readable name for the configuration." ;
113
115
} ;
Original file line number Diff line number Diff line change 5
5
pkgs ,
6
6
...
7
7
} :
8
- with lib ;
9
8
let
9
+ inherit ( lib )
10
+ mkAdapterOption
11
+ mkEnableOption
12
+ mkOption
13
+ mkSignOption
14
+ optionalString
15
+ types
16
+ ;
17
+
10
18
cfg = config . plugins . dap ;
19
+
11
20
dapHelpers = import ./dapHelpers.nix { inherit lib helpers ; } ;
12
21
in
13
- with dapHelpers ;
14
22
{
15
23
imports = [
16
24
./dap-go.nix
@@ -30,8 +38,8 @@ with dapHelpers;
30
38
} ;
31
39
32
40
adapters = helpers . mkCompositeOption "Dap adapters." {
33
- executables = mkAdapterOption "executable" executableAdapterOption ;
34
- servers = mkAdapterOption "server" serverAdapterOption ;
41
+ executables = mkAdapterOption "executable" dapHelpers . executableAdapterOption ;
42
+ servers = mkAdapterOption "server" dapHelpers . serverAdapterOption ;
35
43
} ;
36
44
37
45
configurations =
@@ -85,7 +93,7 @@ with dapHelpers;
85
93
}
86
94
// cfg . extraOptions ;
87
95
in
88
- mkIf cfg . enable {
96
+ lib . mkIf cfg . enable {
89
97
extraPlugins = [ cfg . package ] ;
90
98
91
99
extraConfigLua =
You can’t perform that action at this time.
0 commit comments