[Nix-dev] Turn on python3 support for vim in configuration.nix

Wink Saville wink at saville.com
Sat Sep 17 00:18:20 CEST 2016


By default vim installed via configuration.nix doesn't support python3:

environment = {
  systemPackages = with pkgs; [
    vim
  ];
}

$ sudo nixos-rebuild test
$ vim --version | grep python3
... -python3 ...

So after much searching and help from #nixos on freenode I found that
you can add vim_configurable or its alias vimHugeX to turn on a bunch
of options such as clipboard and python but it doesn't turn on
python3:

environment = {
  systemPackages = with pkgs; [
    vimHugeX
  ];
}

$ sudo nixos-rebuild test
$ vim --version | grep 'python3\|clipboard'
+clipboard       +iconv           +path_extra      +toolbar
+cscope          +lispindent      -python3         +vreplace
+eval            +mouse_dec       +startuptime     +xterm_clipboard


This post, https://goo.gl/Bej4Qo, implies you can do it and I added
'nixpkgs.config.vim.python3 = true' but it doesn't work:

  nixpkgs.config = {
    allowUnfree = true;
    vim.python3 = true;
  };

environment = {
  systemPackages = with pkgs; [
    vimHugeX
  ];
}

$ sudo nixos-rebuild test
$ vim --version | grep 'python3\|clipboard'
+clipboard       +iconv           +path_extra      +toolbar
+cscope          +lispindent      -python3         +vreplace
+eval            +mouse_dec       +startuptime     +xterm_clipboard


How how can I turn on python3, i.e. control individual vim
options/features, in configuration.nix?

-- wink


More information about the nix-dev mailing list