{ config, lib, ... }: 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 nanorc5. ''; example = '' set nowrap set tabstospaces set tabsize 4 ''; }; }; }; ###### implementation config = lib.mkIf (cfg.nanorc != "") { environment.etc."nanorc".text = cfg.nanorc; }; }