mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-01 07:01:54 +00:00
programs/nano: Generate nanorc if syntaxHighlight
enabled
* prepend a newline to the `include` directive * generate the nanorc by default, since `cfg.syntaxHighlight` is `true`
This commit is contained in:
parent
c74b019ab2
commit
4dbf45bc5e
@ -2,6 +2,7 @@
|
||||
|
||||
let
|
||||
cfg = config.programs.nano;
|
||||
LF = "\n";
|
||||
in
|
||||
|
||||
{
|
||||
@ -33,9 +34,9 @@ in
|
||||
|
||||
###### implementation
|
||||
|
||||
config = lib.mkIf (cfg.nanorc != "") {
|
||||
config = lib.mkIf (cfg.nanorc != "" || cfg.syntaxHighlight) {
|
||||
environment.etc."nanorc".text = lib.concatStrings [ cfg.nanorc
|
||||
(lib.optionalString cfg.syntaxHighlight ''include "${pkgs.nano}/share/nano/*.nanorc"'') ];
|
||||
(lib.optionalString cfg.syntaxHighlight ''${LF}include "${pkgs.nano}/share/nano/*.nanorc"'') ];
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user