diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index d90c56f2412a..453899175e01 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -53,6 +53,7 @@ ./programs/dconf.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..caea8758d958 100644 --- a/pkgs/applications/editors/nano/default.nix +++ b/pkgs/applications/editors/nano/default.nix @@ -2,17 +2,19 @@ stdenv.mkDerivation (rec { pname = "nano"; - version = "2.3.2"; + version = "2.3.6"; name = "${pname}-${version}"; src = fetchurl { url = "mirror://gnu/nano/${name}.tar.gz"; - sha256 = "1s3b21h5p7r8xafw0gahswj16ai6k2vnjhmd15b491hl0x494c7z"; + sha256 = "a74bf3f18b12c1c777ae737c0e463152439e381aba8720b4bc67449f36a09534"; }; buildInputs = [ ncurses gettext ]; + configureFlags = "sysconfdir=/etc"; + meta = { homepage = http://www.nano-editor.org/; description = "A small, user-friendly console text editor";