nano: support system-wide nanorc

This patch does two things
1. builds nano with sysconfdir=/etc; and
2. adds an option programs.nano.nanorc
This commit is contained in:
Joachim Fasting 2014-08-01 13:08:13 +02:00
parent 64561b437d
commit decb4266f1
3 changed files with 38 additions and 0 deletions

View file

@ -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

View file

@ -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 <citerefentry><refentrytitle>nanorc</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
'';
example = ''
set nowrap
set tabstospaces
set tabsize 4
'';
};
};
};
###### implementation
config = lib.mkIf (cfg.nanorc != "") {
environment.etc."nanorc".text = cfg.nanorc;
};
}

View file

@ -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";