You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

default.nix 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. { stdenv, fetchurl, fetchFromGitHub
  2. , ncurses
  3. , texinfo
  4. , gettext ? null
  5. , enableNls ? true
  6. , enableTiny ? false
  7. }:
  8. assert enableNls -> (gettext != null);
  9. with stdenv.lib;
  10. let
  11. nixSyntaxHighlight = fetchFromGitHub {
  12. owner = "seitz";
  13. repo = "nanonix";
  14. rev = "bf8d898efaa10dce3f7972ff765b58c353b4b4ab";
  15. sha256 = "0773s5iz8aw9npgyasb0r2ybp6gvy2s9sq51az8w7h52bzn5blnn";
  16. };
  17. in stdenv.mkDerivation rec {
  18. pname = "nano";
  19. version = "4.5";
  20. src = fetchurl {
  21. url = "mirror://gnu/nano/${pname}-${version}.tar.xz";
  22. sha256 = "0czmz1yq8s5qcxcmfjdxzg9nkhbmlc9q1nz04jvf57fdbs7w7mfy";
  23. };
  24. nativeBuildInputs = [ texinfo ] ++ optional enableNls gettext;
  25. buildInputs = [ ncurses ];
  26. outputs = [ "out" "info" ];
  27. configureFlags = [
  28. "--sysconfdir=/etc"
  29. (stdenv.lib.enableFeature enableNls "nls")
  30. (stdenv.lib.enableFeature enableTiny "tiny")
  31. ];
  32. postInstall = ''
  33. cp ${nixSyntaxHighlight}/nix.nanorc $out/share/nano/
  34. '';
  35. enableParallelBuilding = true;
  36. meta = {
  37. homepage = https://www.nano-editor.org/;
  38. description = "A small, user-friendly console text editor";
  39. license = licenses.gpl3Plus;
  40. maintainers = with maintainers; [
  41. joachifm
  42. ];
  43. platforms = platforms.all;
  44. };
  45. }