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
notmuch: add vim plugin #104407
base: master
Are you sure you want to change the base?
notmuch: add vim plugin #104407
Conversation
Install the vim plugin to $out/share/vim. It is only static files and doesn't add any dependency so it is enabled by default. Add a `withVim` argument to override this.
They are required by the vim plugin. Use a setup-hook to set RUBYLIB. This seems like a hacky way.
In case I do want to use the "mail" gem, how to enable it? |
Can you update the title to something like |
Sorry for the broken title. @kisik21 The mail gem is in nixpkgs already: |
Oh, so vim's ruby support just takes packages from the environment? Sounds impure but can be taken care of with a wrapper, so not a bug per se, just an inconvenience (or a convenient feature, depending on your point of view) |
It's searching in paths ( |
This is a semi-automatic executed nixpkgs-review which is checked by a human on a best effort basis and does not build all packages (e.g. lumo, tensorflow or pytorch). Result of 1 package failed to build and are new build failure:
12 packages built:
|
I marked this as stale due to inactivity. → More info |
@@ -90,6 +91,8 @@ stdenv.mkDerivation rec { | |||
|
|||
postInstall = stdenv.lib.optionalString withEmacs '' | |||
moveToOutput bin/notmuch-emacs-mua $emacs | |||
'' + optionalString withVim '' | |||
make -C vim DESTDIR="$out/share/vim" prefix="" install |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this path working for you? I am fairly sure that it'd be safer to do the following:
make -C vim DESTDIR="$out/share/vim-plugins/notmuch" prefix="" install
Also for Neovim users, it'd be nice if you'd also add here:
mkdir -p $out/share/nvim
ln -s $out/share/vim-plugins/notmuch $out/share/nvim/site
@@ -93,6 +93,16 @@ stdenv.mkDerivation rec { | |||
moveToOutput bin/notmuch-emacs-mua $emacs | |||
'' + optionalString withVim '' | |||
make -C vim DESTDIR="$out/share/vim" prefix="" install | |||
'' + optionalString (!isNull ruby) '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about adding a bit more discoverable argument such as withRuby
?
make -C bindings/ruby install DESTDIR="" prefix="$out" install | ||
# This is very specific, see pkgs/development/interpreters/ruby/default.nix | ||
mkdir -p $out/nix-support | ||
cat > $out/nix-support/setup-hook <<EOF |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you explain a bit more how does this work? Perhaps you can alternatively patch notmuch.vim
to use a ruby interpreter that has the bindings from bindings/ruby
.
Hi !
This PR adds notmuch's Vim plugin and Ruby bindings. The Ruby bindings are required by the Vim plugin.
The first commit is a bit unrelated, it removes
emacs
from the build dependencies whenwithEmacs
isfalse
. I don't even want this on my computer ! (kidding, it was just an easy fix)The Vim plugin is enabled by default because it consists only of small static files. The ruby bindings are not big either and ruby is already added as a dependency. Also emacs is enabled by default, so it's fair.
The way I hook the ruby bindings doesn't seem right. I couldn't find examples in nixpkgs and I think
bundlerEnv
cannot be used here. Is here a better way ?The ruby bindings have a dependency on the gem
mail
but it is optional and loaded at runtime, so I haven't included it.There is a related issue: #43965
Motivation for this change
Make the Vim plugin available from nixpkgs and to use it like this:
I got a bit creative here, I'll probably use something saner :D
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)