Nixpkgs: Please include `vi` in minimal install image.

Created on 31 Oct 2016  Â·  13Comments  Â·  Source: NixOS/nixpkgs

Issue description

There is no vi-like editor in minimal installation media. I know there is nano but it is hard to use once you vim-infected. Please, at least, add vi if you think terminal vim is too big to be included in the installation media.

nixos-minimal-16.09.877.5b08a40-x86_64-linux.iso

Steps to reproduce

Technical details

  • System: (NixOS: nixos-version, Ubuntu/Fedora: lsb_release -a, ...)
    16.09.877.5b08a40
  • Nix version: (run nix-env --version)
    nix-env (Nix) 1.11.4
  • Nixpkgs version: (run nix-instantiate --eval '<nixpkgs>' -A lib.nixpkgsVersion)
enhancement nixos vim

Most helpful comment

I today downloaded the minimal iso image and it contained vim actually. Was it recently added?
Otherwise using the following expression:

vimMinimal = (vimUtils.makeCustomizable (callPackage ../applications/editors/vim/configurable.nix {
  inherit (darwin.apple_sdk.frameworks) CoreServices Cocoa Foundation CoreData;
  inherit (darwin) libobjc cf-private;
  lua = pkgs.lua5_1;
  config.vim = {
    lua = false;
    python = false;
    ruby = false;
  };

  features = "small"; # one of  tiny, small, normal, big or huge
  gui = "no";
})).merge {
  postFixup = ''
    rm -r $out/share $out/bin/vimtutor
  '';
};

I get a variant of vim which is only about 630Kb big (without squashfs compression), which is less then loading this issue page on github.

All 13 comments

Yes! I can't push this enough! Every major distro has at least vi in their install image (possibly linked vim to vi as well).

I don't see why we would want to have vi or vim in systemPackages. That would mean that any NixOS installation automatically had both nano and vi(m) installed (and of course, you are using emacs then…).

The minimal iso does require network access anyways, so why not just nix-env -iA nixos.vim?

@sternenseemann Don't have to use nano to edit a network configuration file (if needed) to get network access first.

@sternenseemann: what's on ISO doesn't determine the default nixos systemPackages.

I am really for a vi like editor but vim is just way too much.

I suggest something like _busybox_' vi.

@vcunat oh, right. My bad.

@sternenseemann

I don't see why we would want to have vi or vim in systemPackages.

I don't see why any editor should be part of the system. The ISO however should contain a range of minimal editors (neither vim nor emacs) to make it easier for people to install/configure/rescue their system.

@benaryorg Yeah, of course, I just thought, that the minimal iso contains systemPackages plus some installation tools, but I was wrong, forgive me. :)

The standard for nix has been *vi for ages, it's a bit puzzling: I'm trying NixOS live, I need to edit the configuration to setup networking and there's no vi. To get vi, I need networking.

I guess there are more vi users than nano out there, might make sense to include it.

I also think it's important to include either vi or vim in the minimal install image.

I thought it would be best to include some links/references to show why this would be a good idea.

https://en.wikipedia.org/wiki/List_of_text_editors#System_default:

vi is the default for Unix systems and must be included in all POSIX compliant systems

https://en.wikipedia.org/wiki/Vi:

Over the years since its creation, vi became the de facto standard Unix editor and a nearly undisputed hacker favorite[citation needed] outside of MIT until the rise of Emacs after about 1984. The Single UNIX Specification specifies vi, so every conforming system must have it. vi is still widely used by users of the Unix family of operating systems. About half the respondents in a 1991 USENET poll preferred vi.

Some rankings I've found (in the order they appeared on my search engine - I only removed the ones preferring GUI editors or lacking nano):

http://www.tecmint.com/best-open-source-linux-text-editors/:

It is one the most popular and widely used text editors among System Administrators and programmers that is why many users often refer to it as a programmer’s editor.

http://www.hostingadvice.com/blog/5-popular-text-editors-linux/:

Vi or its later generation enhanced version, Vim, has been part of Linux from the start.

http://www.thegeekstuff.com/2009/07/top-5-best-linux-text-editors:

Vim won by a huge margin and I don’t think this is surprise to anybody.

http://www.yolinux.com/TUTORIALS/LinuxTextEditors.html:

This editor is ubiquitous and available on all Linux systems and is the "standard" Linux editor.

A comparison of the binary sizes according to the Arch DB (absolute and relative compared to nano):

I think this comparison shows pretty well why vi (or vim) should be (and is - imho) the default editor for every GNU/Linux distribution (POSIX, UNIX, even on embedded systems, etc.) and imho most (if not all) system administrators will use vi and vim.

I today downloaded the minimal iso image and it contained vim actually. Was it recently added?
Otherwise using the following expression:

vimMinimal = (vimUtils.makeCustomizable (callPackage ../applications/editors/vim/configurable.nix {
  inherit (darwin.apple_sdk.frameworks) CoreServices Cocoa Foundation CoreData;
  inherit (darwin) libobjc cf-private;
  lua = pkgs.lua5_1;
  config.vim = {
    lua = false;
    python = false;
    ruby = false;
  };

  features = "small"; # one of  tiny, small, normal, big or huge
  gui = "no";
})).merge {
  postFixup = ''
    rm -r $out/share $out/bin/vimtutor
  '';
};

I get a variant of vim which is only about 630Kb big (without squashfs compression), which is less then loading this issue page on github.

I today downloaded the minimal iso image and it contained vim actually. Was it recently added?

@Mic92 You're right, seems like it has already been added on the 28.12.2016 by the following commit: e0078b2cb536c3af0f820d484f46dc9b83547678 (0ae95d808eafbf817a15744dd335941885496928 and cherry-picked to nixpkgs-channels).

Edit: And the vim derivation takes up ~29 MiB in the store so reducing that to ~630 Kb would probably make sense.

Moved it to the install-device profile to enable it for netboot, too.

Was this page helpful?
0 / 5 - 0 ratings