nano: add nix syntax hightlight, nano module: provide default (#21912)
this is awesome! thanks.
This commit is contained in:
committed by
Joachim Schiele
parent
5c7ecab75c
commit
4a662e5206
@@ -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"'') ];
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user