1 { config, lib, pkgs, ... }:
4 cfg = config.programs.nano;
10 enable = lib.mkEnableOption "nano, a small user-friendly console text editor" // {
14 package = lib.mkPackageOption pkgs "nano" { };
16 nanorc = lib.mkOption {
17 type = lib.types.lines;
20 The system-wide nano configuration.
21 See {manpage}`nanorc(5)`.
30 syntaxHighlight = lib.mkOption {
31 type = lib.types.bool;
33 description = "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 ];
46 pathsToLink = [ "/share/nano" ];