diff options
author | gnidorah <gnidorah@users.noreply.github.com> | 2017-01-18 14:05:30 +0300 |
---|---|---|
committer | Joachim Schiele <js@lastlog.de> | 2017-01-18 12:05:30 +0100 |
commit | 4a662e5206703868b13e9ac01d401c66d997f800 (patch) | |
tree | 44a56d39cafb1a92f82f9b271e2ea69e9d1434f1 /nixos | |
parent | 5c7ecab75cf067cbb9fa34b73a2d23cd4f5e55d0 (diff) |
nano: add nix syntax hightlight, nano module: provide default (#21912)
this is awesome! thanks.
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/programs/nano.nix | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/nixos/modules/programs/nano.nix b/nixos/modules/programs/nano.nix index b8803eec7be1d..27b6d446c75d7 100644 --- a/nixos/modules/programs/nano.nix +++ b/nixos/modules/programs/nano.nix @@ -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"'') ]; }; } |