mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-15 22:19:17 +03: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
1 changed files with 3 additions and 2 deletions
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.programs.nano;
|
cfg = config.programs.nano;
|
||||||
|
LF = "\n";
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -33,9 +34,9 @@ in
|
||||||
|
|
||||||
###### implementation
|
###### implementation
|
||||||
|
|
||||||
config = lib.mkIf (cfg.nanorc != "") {
|
config = lib.mkIf (cfg.nanorc != "" || cfg.syntaxHighlight) {
|
||||||
environment.etc."nanorc".text = lib.concatStrings [ cfg.nanorc
|
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…
Add table
Add a link
Reference in a new issue