2017-01-18 11:05:30 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
2014-08-01 12:08:13 +01:00
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.programs.nano;
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
###### interface
|
|
|
|
|
|
|
|
options = {
|
|
|
|
programs.nano = {
|
|
|
|
|
|
|
|
nanorc = lib.mkOption {
|
|
|
|
type = lib.types.lines;
|
|
|
|
default = "";
|
|
|
|
description = ''
|
|
|
|
The system-wide nano configuration.
|
|
|
|
See <citerefentry><refentrytitle>nanorc</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
|
|
|
|
'';
|
|
|
|
example = ''
|
|
|
|
set nowrap
|
|
|
|
set tabstospaces
|
2017-01-18 11:05:30 +00:00
|
|
|
set tabsize 2
|
2014-08-01 12:08:13 +01:00
|
|
|
'';
|
|
|
|
};
|
2017-01-18 11:05:30 +00:00
|
|
|
syntaxHighlight = lib.mkOption {
|
|
|
|
type = lib.types.bool;
|
|
|
|
default = true;
|
|
|
|
description = "Whether to enable syntax highlight for various languages.";
|
|
|
|
};
|
2014-08-01 12:08:13 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
###### implementation
|
|
|
|
|
|
|
|
config = lib.mkIf (cfg.nanorc != "") {
|
2017-01-18 11:05:30 +00:00
|
|
|
environment.etc."nanorc".text = lib.concatStrings [ cfg.nanorc
|
|
|
|
(lib.optionalString cfg.syntaxHighlight ''include "${pkgs.nano}/share/nano/*.nanorc"'') ];
|
2014-08-01 12:08:13 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|