nano: support system-wide nanorc

This patch does two things
1. builds nano with sysconfdir=/etc; and
2. adds an option programs.nano.nanorc
wip/yesman
Joachim Fasting 10 years ago
parent 64561b437d
commit decb4266f1
  1. 1
      nixos/modules/module-list.nix
  2. 35
      nixos/modules/programs/nano.nix
  3. 2
      pkgs/applications/editors/nano/default.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

@ -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…
Cancel
Save