File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,12 @@ with lib; {
3434 description = "Neovim to use for NixVim." ;
3535 } ;
3636
37+ styleInit = mkOption {
38+ type = types . bool ;
39+ default = false ;
40+ description = "Style the `init.lua` file." ;
41+ } ;
42+
3743 wrapRc = mkOption {
3844 type = types . bool ;
3945 description = "Should the config be included in the wrapper script." ;
@@ -115,7 +121,17 @@ with lib; {
115121 ''
116122 + config . content ;
117123
118- init = pkgs . writeText "init.lua" customRC ;
124+ initRaw = pkgs . writeText "init.lua" customRC ;
125+ initStyled =
126+ pkgs . runCommand "init.lua" {
127+ buildInputs = [ pkgs . stylua ] ;
128+ } ''
129+ cat ${ initRaw } | stylua - > $out
130+ '' ;
131+ init =
132+ if config . styleInit
133+ then initStyled
134+ else initRaw ;
119135 initPath = toString init ;
120136
121137 extraWrapperArgs = builtins . concatStringsSep " " (
You can’t perform that action at this time.
0 commit comments