[Nix-dev] Overriding python with python3 in vim_configurable.customize

Ben Zhang benzhangniu at gmail.com
Wed Apr 5 05:18:32 CEST 2017


Thanks everyone for your input! I ended up using zimbatm’s method and made a python3 version of `vim_configurable` using `vimUtils.makeCustomizable`. Now it’s working great!

My current `vim-config/default.nix`:

```
{ pkgs }:

let
  my_plugins = import ./plugins.nix { inherit (pkgs) vimUtils fetchFromGitHub; };
  configurable_nix_path = "${<nixpkgs>}/pkgs/applications/editors/vim/configurable.nix";
  my_vim_configurable = with pkgs; vimUtils.makeCustomizable (callPackage configurable_nix_path {
    inherit (darwin.apple_sdk.frameworks) CoreServices Cocoa Foundation CoreData;
    inherit (darwin) libobjc cf-private;

    features = "huge"; # one of  tiny, small, normal, big or huge
    lua = pkgs.lua5_1;
    gui = config.vim.gui or "auto";
    python = python3;

    # optional features by flags
    flags = [ "python" "X11" ];
  });

in with pkgs; my_vim_configurable.customize {
  name = "vim";
  vimrcConfig = {
    customRC = ''
      syntax on
      “...
    '';

    vam.knownPlugins = vimPlugins // my_plugins;
    vam.pluginDictionaries = [
      { names = [
        "ctrlp"
        # ...
      ]; }
    ];
  };
}
```

Ben

On Apr 4, 2017, 8:08 PM -0400, Rok Garbas <rok at garbas.si>, wrote:
> Maybe give neovim a try. It is can be configured very similarly and I can confirm that python3 and python support work.
>
> -- garbas
>
> > On 04 April 2017 at 21:42 Linus Heckemann <acc at sphalerite.org> wrote:src/releng_slavehealth/releng_slavehealth/__init__.py
> >
> >
> > On 04/04/17 17:40, zimbatm wrote:
> > > Look into pkgs/top-level/all-packages.nix. I would start by copying the
> > > definition of vim_configurable from there and set the python argument.
> > >
> > >
> > > On Tue, 4 Apr 2017, 14:08 Ben Zhang, <benzhangniu at gmail.com
> > > <mailto:benzhangniu at gmail.com>> wrote:
> > >
> > > From the source code, it doesn’t seem to accept a python argument
> > > (https://github.com/nicknovitski/nixpkgs/blob/master/pkgs/misc/vim-plugins/vim-utils.nix#L291-L295).
> > > Is there another way to override `python` with `python3`
> > > (https://github.com/NixOS/nixpkgs/pull/8125#issuecomment-169471686)?
> > >
> >
> >
> > Another potential option would be using package overrides [1] to pass
> > python3 as python to the vim package — something like
> >
> > packageOverrides = pkgs: {
> > vim = pkgs.vim.override { python = pkgs.python3 };
> > };
> >
> > [1]: https://nixos.org/nixpkgs/manual/#sec-modify-via-packageOverrides
> >
> >
> > _______________________________________________
> > nix-dev mailing list
> > nix-dev at lists.science.uu.nl
> > http://lists.science.uu.nl/mailman/listinfo/nix-dev
>
> -- Rok Garbas, https://garbas.si
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.science.uu.nl/pipermail/nix-dev/attachments/20170404/71b5cf55/attachment.html>


More information about the nix-dev mailing list