3
0
Fork 0
forked from mirrors/nixpkgs

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:
Claudio Bley 2019-01-14 23:01:06 +01:00
parent c74b019ab2
commit 4dbf45bc5e

View file

@ -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"'') ];
};
}