nano: add nix syntax hightlight, nano module: provide default (#21912)

this is awesome! thanks.
This commit is contained in:
gnidorah
2017-01-18 12:05:30 +01:00
committed by Joachim Schiele
parent 5c7ecab75c
commit 4a662e5206
2 changed files with 22 additions and 5 deletions
+9 -3
View File
@@ -1,4 +1,4 @@
{ config, lib, ... }:
{ config, lib, pkgs, ... }:
let
cfg = config.programs.nano;
@@ -20,16 +20,22 @@ in
example = ''
set nowrap
set tabstospaces
set tabsize 4
set tabsize 2
'';
};
syntaxHighlight = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Whether to enable syntax highlight for various languages.";
};
};
};
###### implementation
config = lib.mkIf (cfg.nanorc != "") {
environment.etc."nanorc".text = cfg.nanorc;
environment.etc."nanorc".text = lib.concatStrings [ cfg.nanorc
(lib.optionalString cfg.syntaxHighlight ''include "${pkgs.nano}/share/nano/*.nanorc"'') ];
};
}