New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nano: add nix syntax hightlight, nano module: provide default #21912
Conversation
@gnidorah, thanks for your PR! By analyzing the history of the files in this pull request, we identified @joachifm, @mimadrid and @gridaphobe to be potential reviewers. |
set nowrap | ||
set tabstospaces | ||
set tabsize 2 | ||
include "${pkgs.nano}/share/nano/*.nanorc" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this line be added always? Not only when no other value is set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@globin sorry, what do you want to ask?
i see problems in the tabstospaces
and tabsize
definition. the include just makes the nix-highlight but basically all highlights a default, which would be a huge win.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@globin For me this line is not added when I set programs.nano.nanorc
in configuration.nix, or am I miss something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gnidorah I took that to mean that perhaps the include should be addded unconditionally
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@joachifm Not sure it's a good idea, user may wish not to load these highlights
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that now nix must build nano to generate the manual; usually, we use defaultText
to work around that.
Perhaps enabling syntax highlighting could be made into an option?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps enabling syntax highlighting could be made into an option?
Added, thank you!
Note that now nix must build nano to generate the manual; usually, we use defaultText to work around that.
Should I just put defaultText = "something";
? I see manual gets rebuilded only when I change default value in module file, not when I overwrite programs.nano.nanorc
in configuration.nix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not necessary to set defaultText
now; it's a hack to avoid incurring lots of work to render the manual (typically whenever the default value refers to a package or other non-trivial artefact).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's also to make build artefacts render better; package values tend to not look very good when rendered directly, to the point of being useless to the reader (compare the rendered result of default = pkgs.foo
versus defaultText = "pkgs.foo"
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gnidorah
please remove the tabstospaces
as it will destroy Makefiles
for instance. if you fix that last bit i will just merge it. thanks for all your work!
set nowrap | ||
set tabstospaces | ||
set tabsize 2 | ||
include "${pkgs.nano}/share/nano/*.nanorc" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@globin sorry, what do you want to ask?
i see problems in the tabstospaces
and tabsize
definition. the include just makes the nix-highlight but basically all highlights a default, which would be a huge win.
@qknight Thanks! The default was composed for nix files in mind, but since it breaks Makefile format, I've undo that change. |
cc @seitz
Motivation for this change
Things done
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)