diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 2cbda50ba29d..2e0230f2b5e5 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -52,6 +52,7 @@ ./programs/blcr.nix ./programs/environment.nix ./programs/info.nix + ./programs/nano.nix ./programs/screen.nix ./programs/shadow.nix ./programs/shell.nix diff --git a/nixos/modules/programs/nano.nix b/nixos/modules/programs/nano.nix new file mode 100644 index 000000000000..b8803eec7be1 --- /dev/null +++ b/nixos/modules/programs/nano.nix @@ -0,0 +1,35 @@ +{ 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; + }; + +} diff --git a/pkgs/applications/editors/nano/default.nix b/pkgs/applications/editors/nano/default.nix index c347a038ac9a..61cea68fa78d 100644 --- a/pkgs/applications/editors/nano/default.nix +++ b/pkgs/applications/editors/nano/default.nix @@ -13,6 +13,8 @@ stdenv.mkDerivation (rec { buildInputs = [ ncurses gettext ]; + configureFlags = "sysconfdir=/etc"; + meta = { homepage = http://www.nano-editor.org/; description = "A small, user-friendly console text editor";