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
3 changed files with 38 additions and 0 deletions
|
@ -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
|
||||
|
|
35
nixos/modules/programs/nano.nix
Normal file
35
nixos/modules/programs/nano.nix
Normal 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;
|
||||
};
|
||||
|
||||
}
|
|
@ -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";
|
||||
|
|
Loading…
Reference in a new issue