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:
parent
64561b437d
commit
decb4266f1
|
@ -52,6 +52,7 @@
|
||||||
./programs/blcr.nix
|
./programs/blcr.nix
|
||||||
./programs/environment.nix
|
./programs/environment.nix
|
||||||
./programs/info.nix
|
./programs/info.nix
|
||||||
|
./programs/nano.nix
|
||||||
./programs/screen.nix
|
./programs/screen.nix
|
||||||
./programs/shadow.nix
|
./programs/shadow.nix
|
||||||
./programs/shell.nix
|
./programs/shell.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 <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;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
|
@ -13,6 +13,8 @@ stdenv.mkDerivation (rec {
|
||||||
|
|
||||||
buildInputs = [ ncurses gettext ];
|
buildInputs = [ ncurses gettext ];
|
||||||
|
|
||||||
|
configureFlags = "sysconfdir=/etc";
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
homepage = http://www.nano-editor.org/;
|
homepage = http://www.nano-editor.org/;
|
||||||
description = "A small, user-friendly console text editor";
|
description = "A small, user-friendly console text editor";
|
||||||
|
|
Loading…
Reference in New Issue