From 4dbf45bc5ea4f872413cffda9570420d35f40f8c Mon Sep 17 00:00:00 2001 From: Claudio Bley Date: Mon, 14 Jan 2019 23:01:06 +0100 Subject: [PATCH] programs/nano: Generate nanorc if `syntaxHighlight` enabled * prepend a newline to the `include` directive * generate the nanorc by default, since `cfg.syntaxHighlight` is `true` --- nixos/modules/programs/nano.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nixos/modules/programs/nano.nix b/nixos/modules/programs/nano.nix index 27b6d446c75d..6a4d46338e19 100644 --- a/nixos/modules/programs/nano.nix +++ b/nixos/modules/programs/nano.nix @@ -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"'') ]; }; }