File tree 4 files changed +60
-50
lines changed
4 files changed +60
-50
lines changed Original file line number Diff line number Diff line change 87
87
packages = self . packages . ${ system } ;
88
88
plugins = pkgs . lazynvimPlugins ;
89
89
90
+ buildPkg = pkg : pkgs . runCommand "${ pkg . name } -build" { env . PKG = pkg ; } "touch $out" ;
90
91
addAttrsetPrefix = prefix : lib . attrsets . concatMapAttrs ( n : v : { "${ prefix } ${ n } " = v ; } ) ;
91
92
localTests = lib . attrsets . concatMapAttrs (
92
93
pkgName : pkg :
93
94
if ( builtins . hasAttr "tests" pkg ) then
94
- ( { "${ pkgName } -build" = pkg ; } // ( addAttrsetPrefix "${ pkgName } -tests-" pkg . tests ) )
95
+ ( { "${ pkgName } -build" = buildPkg pkg ; } // ( addAttrsetPrefix "${ pkgName } -tests-" pkg . tests ) )
95
96
else
96
- { "${ pkgName } -build" = pkg ; }
97
+ { "${ pkgName } -build" = buildPkg pkg ; }
97
98
) self . packages . ${ system } ;
98
99
in
99
100
{
105
106
nativeBuildInputs = [ packages . lazy-nvim ] ;
106
107
}
107
108
''
108
- HOME="$PWD" nvim --headless "+Lazy! home" --startuptime out~ +q 2>&1 | tee err
109
+ HOME="$PWD" nvim --headless "+Lazy! home" --startuptime out +q 2>&1 | tee err
109
110
if grep "^E[0-9]\\+: " err; then
110
111
cat err
111
112
exit 1
112
113
fi
113
- mv out~ "$out"
114
+ cat out
115
+ touch $out
114
116
'' ;
115
117
116
118
LazyVimPlugins-outdated =
122
124
}
123
125
''
124
126
diff --unified $actual $expected
125
- touch " $out"
127
+ touch $out
126
128
'' ;
127
129
128
- LazyVim-extras-catppuccin = plugins . LazyVim . extras . "lazyvim.plugins" . catppuccin ;
130
+ LazyVim-extras-catppuccin = buildPkg plugins . LazyVim . extras . "lazyvim.plugins" . catppuccin ;
129
131
LazyVim-extras-all = pkgs . runCommandLocal "LazyVim-extras-all" {
130
132
buildInputs = lib' . flattenDerivations plugins . LazyVim . extras ;
131
133
} "touch $out" ;
Original file line number Diff line number Diff line change 1
1
{
2
2
lib ,
3
3
callPackage ,
4
+ runCommand ,
4
5
writeTextFile ,
5
6
lazynvimPlugins ,
6
7
lazynvimUtils ,
@@ -19,49 +20,55 @@ writeTextFile {
19
20
} )
20
21
'' ;
21
22
22
- passthru . tests = {
23
- example = callPackage ./lazy-nvim-config.nix {
24
- luaRcContent = ''
25
- vim.g.mapleader = " "
26
- vim.g.maplocalleader = "\\"
27
- '' ;
23
+ passthru . tests =
24
+ let
25
+ example = callPackage ./lazy-nvim-config.nix {
26
+ luaRcContent = ''
27
+ vim.g.mapleader = " "
28
+ vim.g.maplocalleader = "\\"
29
+ '' ;
28
30
29
- # https://lazy.folke.io/spec/examples
30
- spec = [
31
- {
32
- url = "folke/tokyonight.nvim" ;
33
- lazy = false ;
34
- priority = 1000 ;
35
- config = lib . generators . mkLuaInline ''
36
- function()
37
- -- load the colorscheme here
38
- vim.cmd([[colorscheme tokyonight]])
39
- end
40
- '' ;
41
- }
42
- {
43
- url = "folke/which-key.nvim" ;
44
- lazy = true ;
45
- }
46
- {
47
- url = "nvim-neorg/neorg" ;
48
- ft = "norg" ;
49
- opts = {
50
- load = {
51
- "core.defaults" = { } ;
31
+ # https://lazy.folke.io/spec/examples
32
+ spec = [
33
+ {
34
+ url = "folke/tokyonight.nvim" ;
35
+ lazy = false ;
36
+ priority = 1000 ;
37
+ config = lib . generators . mkLuaInline ''
38
+ function()
39
+ -- load the colorscheme here
40
+ vim.cmd([[colorscheme tokyonight]])
41
+ end
42
+ '' ;
43
+ }
44
+ {
45
+ url = "folke/which-key.nvim" ;
46
+ lazy = true ;
47
+ }
48
+ {
49
+ url = "nvim-neorg/neorg" ;
50
+ ft = "norg" ;
51
+ opts = {
52
+ load = {
53
+ "core.defaults" = { } ;
54
+ } ;
52
55
} ;
53
- } ;
54
- }
55
- ] ;
56
+ }
57
+ ] ;
56
58
57
- opts = {
58
- install = {
59
- colorscheme = [ "habamax" ] ;
60
- } ;
61
- checker = {
62
- enabled = true ;
59
+ opts = {
60
+ install = {
61
+ colorscheme = [ "habamax" ] ;
62
+ } ;
63
+ checker = {
64
+ enabled = true ;
65
+ } ;
63
66
} ;
64
67
} ;
68
+ in
69
+ {
70
+ example = runCommand "lazy-nvim-config-example" {
71
+ CONFIG = example ;
72
+ } "touch $out" ;
65
73
} ;
66
- } ;
67
74
}
Original file line number Diff line number Diff line change 66
66
in
67
67
{
68
68
help = runCommand "nvim-help" { nativeBuildInputs = [ neovim ] ; } ''
69
- nvim --help 2>&1 >out~
70
- mv out~ " $out"
69
+ nvim --help 2>&1
70
+ touch $out
71
71
'' ;
72
72
73
73
checkhealth = neovim-checkhealth . override {
120
120
} ;
121
121
122
122
startuptime = runCommand "nvim-startuptime" { nativeBuildInputs = [ neovim ] ; } ''
123
- HOME="$PWD" nvim --headless "+Lazy! home" --startuptime out~ +q 2>&1 | tee err
123
+ HOME="$PWD" nvim --headless "+Lazy! home" --startuptime out +q 2>&1 | tee err
124
124
if grep "^E[0-9]\\+: " err; then
125
125
cat err
126
126
exit 1
127
127
fi
128
- mv out~ "$out"
128
+ cat out
129
+ touch $out
129
130
'' ;
130
131
} ;
131
132
}
Original file line number Diff line number Diff line change @@ -71,6 +71,6 @@ runCommand "checkhealth-${pluginName}"
71
71
echo "Expected at least one OK" >&2
72
72
return 1
73
73
else
74
- mv out.txt " $out"
74
+ touch $out
75
75
fi
76
76
''
You can’t perform that action at this time.
0 commit comments