From decb4266f19722dab8da7ecfd0667ad2a4022b7a Mon Sep 17 00:00:00 2001 From: Joachim Fasting Date: Fri, 1 Aug 2014 13:08:13 +0200 Subject: [PATCH 1/2] nano: support system-wide nanorc This patch does two things 1. builds nano with sysconfdir=/etc; and 2. adds an option programs.nano.nanorc --- nixos/modules/module-list.nix | 1 + nixos/modules/programs/nano.nix | 35 ++++++++++++++++++++++ pkgs/applications/editors/nano/default.nix | 2 ++ 3 files changed, 38 insertions(+) create mode 100644 nixos/modules/programs/nano.nix diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 2cbda50ba29..2e0230f2b5e 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 00000000000..b8803eec7be --- /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 c347a038ac9..61cea68fa78 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"; From 2fc0537018180b32071ea350cc22d86115adf9e8 Mon Sep 17 00:00:00 2001 From: Joachim Fasting Date: Fri, 1 Aug 2014 15:40:16 +0200 Subject: [PATCH 2/2] nano: bump to version 2.3.6 --- pkgs/applications/editors/nano/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/editors/nano/default.nix b/pkgs/applications/editors/nano/default.nix index 61cea68fa78..caea8758d95 100644 --- a/pkgs/applications/editors/nano/default.nix +++ b/pkgs/applications/editors/nano/default.nix @@ -2,13 +2,13 @@ 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 ];