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

neovim: Allow overriding the derivation of neovim even through the c... #27056

Closed
wants to merge 1 commit into from

Conversation

Nadrieril
Copy link
Member

…onfiguration wrapper

Motivation for this change

When using the neovim configuration options, the neovim derivation gets replaced by a wrapper that links to the actual neovim derivation output. In doing so, it hides the normal neovim derivation.
The problem is that if one wants to override an attribute of the underlying neovim (say, to patch it), using overrideAttrs will instead modify the wrapper, which is not the desired behavior.

This PR makes it so that calling pkgs.neovim.overrideAttrs always overrides the expected derivation, even when neovim gets configured before of after.

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@mention-bot
Copy link

@Nadrieril, thanks for your PR! By analyzing the history of the files in this pull request, we identified @garbas, @nckx and @manveru to be potential reviewers.

@Nadrieril Nadrieril changed the title [neovim] Allow overriding the derivation of neovim even through the c… neovim: Allow overriding the derivation of neovim even through the c... Jul 2, 2017
@FRidh
Copy link
Member

FRidh commented Jul 3, 2017

When using the neovim configuration options, the neovim derivation gets replaced by a wrapper that links to the actual neovim derivation output. In doing so, it hides the normal neovim derivation.

In my opinion a wrapper should always be returned for the sake of consistency.

The problem is that if one wants to override an attribute of the underlying neovim (say, to patch it), using overrideAttrs will instead modify the wrapper, which is not the desired behavior.

overrideAttrs should override the call to stdenv.mkDerivation of the derivation that is returned. If it returns the wrapped one, then overrideAttrs should override that.

This PR makes it so that calling pkgs.neovim.overrideAttrs always overrides the expected derivation, even when neovim gets configured before of after.

Maybe its better to have an overrideNeovim method then instead for overriding the underlying derivation.

Anyway, I don't use neovim and don't know how its build.

@Nadrieril
Copy link
Member Author

I agree that it would be better to always have a wrapper, but as it is now changing it may break configurations. Actually the best way would be for the wrapper to use pkgs.neovim instead of the locally declared neovim, but this seems tricky to me.

@Nadrieril
Copy link
Member Author

Probably a better way would be to have two separate packages, like what firefox does. This would be very breaking though.

@teto
Copy link
Member

teto commented Jan 7, 2018

I guess #32657 might interest you. It would be nice if you could give it a spin.

@Nadrieril
Copy link
Member Author

Fixed by #32657.

@Nadrieril Nadrieril closed this Jan 17, 2018
@Nadrieril Nadrieril deleted the override-configured-neovim branch February 10, 2018 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants