1 { config, lib, pkgs, ... }:
4 cfg = config.programs.nano;
10 enable = lib.mkEnableOption (lib.mdDoc "nano") // {
14 package = lib.mkPackageOptionMD pkgs "nano" { };
16 nanorc = lib.mkOption {
17 type = lib.types.lines;
19 description = lib.mdDoc ''
20 The system-wide nano configuration.
21 See {manpage}`nanorc(5)`.
30 syntaxHighlight = lib.mkOption {
31 type = lib.types.bool;
33 description = lib.mdDoc "Whether to enable syntax highlight for various languages.";
38 config = lib.mkIf cfg.enable {
40 etc.nanorc.text = (lib.optionalString cfg.syntaxHighlight ''
41 # load syntax highlighting files
42 include "${cfg.package}/share/nano/*.nanorc"
43 include "${cfg.package}/share/nano/extra/*.nanorc"
45 systemPackages = [ cfg.package ];