Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please include vi in minimal install image. #20013

Closed
wizzup opened this issue Oct 31, 2016 · 13 comments
Closed

Please include vi in minimal install image. #20013

wizzup opened this issue Oct 31, 2016 · 13 comments

Comments

@wizzup
Copy link
Contributor

wizzup commented Oct 31, 2016

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)
@matthiasbeyer
Copy link
Contributor

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).

@sternenseemann
Copy link
Member

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?

@vyp
Copy link
Member

vyp commented Nov 1, 2016

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

@vcunat
Copy link
Member

vcunat commented Nov 1, 2016

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

@benaryorg
Copy link
Contributor

benaryorg commented Nov 1, 2016

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

I suggest something like busybox' vi.

@sternenseemann
Copy link
Member

@vcunat oh, right. My bad.

@benaryorg
Copy link
Contributor

@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.

@sternenseemann
Copy link
Member

sternenseemann commented Nov 2, 2016

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

@pietro909
Copy link

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.

@primeos
Copy link
Member

primeos commented Jan 14, 2017

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.

@fpletz fpletz added this to the 17.03 milestone Jan 14, 2017
@Mic92
Copy link
Member

Mic92 commented Jan 17, 2017

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.

@primeos
Copy link
Member

primeos commented Jan 18, 2017

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: e0078b2 (0ae95d8 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.

@globin globin closed this as completed in f4f4200 Jan 18, 2017
@globin
Copy link
Member

globin commented Jan 18, 2017

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

globin added a commit to mayflower/nixpkgs that referenced this issue Jan 18, 2017
This moves vim to the install-device profile to add vim to netboot, too.

Fixes NixOS#20013 (see discussion there for further information)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests