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

vimPlugins: generated.nix as an overlay #83809

Merged
merged 3 commits into from May 16, 2021
Merged

Conversation

teto
Copy link
Member

@teto teto commented Mar 30, 2020

let update.py generates generated.nix as an overlay.
This should help maintaining vim-plugins outside of nixpkgs.

I have several additionnal vim plugins in my nixpkgs checkout that often cause problems when rebasing. Thus I want to maintain these vim plugins in an overlay.
I use ~/nixpkgs/pkgs/misc/vim-plugins/update.py -i config/nixpkgs/overlays/vim-plugins/vim-plugin-names -o config/nixpkgs/overlays/vim-plugins/generated.nix

with config/nixpkgs/overlays/vim-plugins.nix

self: super:
rec {

  inherit (super.vimUtils.override {inherit (super) vim;}) buildVimPluginFrom2Nix;

  generated = super.callPackage ./vim-plugins/generated.nix { 
    inherit buildVimPluginFrom2Nix;
  };
  vimPlugins = super.vimPlugins.extend( generated );
}

for some reason aliases stop working.

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • 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 nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@teto teto changed the title vimPlugins: make it more extensible vimPlugins: generated.nix as an overlay Mar 30, 2020
@grahamc
Copy link
Member

grahamc commented Mar 30, 2020

@GrahamcOfBorg eval

@grahamc
Copy link
Member

grahamc commented Mar 31, 2020

Would you mind rebasing this branch on to master? That will clear the ofborg-internal-error error, now that I fixed the bug I was seeing while evaluating this PR.

@stale
Copy link

stale bot commented Sep 30, 2020

Hello, I'm a bot and I thank you in the name of the community for your contributions.

Nixpkgs is a busy repository, and unfortunately sometimes PRs get left behind for too long. Nevertheless, we'd like to help committers reach the PRs that are still important. This PR has had no activity for 180 days, and so I marked it as stale, but you can rest assured it will never be closed by a non-human.

If this is still important to you and you'd like to remove the stale label, we ask that you leave a comment. Your comment can be as simple as "still important to me". But there's a bit more you can do:

If you received an approval by an unprivileged maintainer and you are just waiting for a merge, you can @ mention someone with merge permissions and ask them to help. You might be able to find someone relevant by using Git blame on the relevant files, or via GitHub's web interface. You can see if someone's a member of the nixpkgs-committers team, by hovering with the mouse over their username on the web interface, or by searching them directly on the list.

If your PR wasn't reviewed at all, it might help to find someone who's perhaps a user of the package or module you are changing, or alternatively, ask once more for a review by the maintainer of the package/module this is about. If you don't know any, you can use Git blame on the relevant files, or GitHub's web interface to find someone who touched the relevant files in the past.

If your PR has had reviews and nevertheless got stale, make sure you've responded to all of the reviewer's requests / questions. Usually when PR authors show responsibility and dedication, reviewers (privileged or not) show dedication as well. If you've pushed a change, it's possible the reviewer wasn't notified about your push via email, so you can always officially request them for a review, or just @ mention them and say you've addressed their comments.

Lastly, you can always ask for help at our Discourse Forum, or more specifically, at this thread or at #nixos' IRC channel.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Sep 30, 2020
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Oct 3, 2020
@teto teto force-pushed the vimPlugins_rework branch 2 times, most recently from e7129bd to 26c662c Compare April 27, 2021 11:59
@teto teto marked this pull request as ready for review April 27, 2021 12:00
@teto teto requested a review from jonringer as a code owner April 27, 2021 12:00
@ofborg ofborg bot requested review from jorsn, hugolgst, jagajaga and MarcWeber May 3, 2021 09:47
@teto
Copy link
Member Author

teto commented May 3, 2021

finally, I've carried this in my fork and it has made every rebase slightly more painful so looking forward to seeing this merged :)

@teto
Copy link
Member Author

teto commented May 10, 2021

cc @Mic92 too

Copy link
Contributor

@jonringer jonringer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree with in principle.

Please address conflicts

@Mic92
Copy link
Member

Mic92 commented May 11, 2021

Can you document the overlay approach in the vim section in the manual?

@teto
Copy link
Member Author

teto commented May 11, 2021

I think the following overlay should work

final: prev: {
          vimPlugins = prev.vimPlugins.extend (
            final2: prev2: {
              octo-nvim = prev.buildVimPluginFrom2Nix {
                pname = "octo-nvim";
                version = "2021-05-06";
                src = prev.fetchFromGitHub {
                  owner = "pwntester";
                  repo = "octo.nvim";
                  rev = "d92a7352516f06a457cbf8812b173abc319f7882";
                  sha256 = "1xvj3p32nzcn8rv2hscmj8sn8bfm1s2r5j1cwwnkl4zbqdbd4k5f";
                };
                meta.homepage = "https://github.com/pwntester/octo.nvim/";
              };
            }

          );
        };

but as soon as I uncomment it nix crashes:
/run/current-system/sw/bin/nixos-rebuild: line 474: 2329477 Segmentation fault (core dumped) nix "${flakeFlags[@]}" build "$flake#$flakeAttr.config.system.build.toplevel" "${extraBuildFlags[@]}" "${lockFlags[@]}".
So I would be tempted to merge now and I will add the doc once those crashes go away ?

@teto
Copy link
Member Author

teto commented May 15, 2021

I've added some logging feature ( update.py --debug INFO) 'cos update.py sometimes fail and it's not straightforward to know what plugin triggered the failure.

teto and others added 2 commits May 17, 2021 00:40
let update.py generates generated.nix as an overlay.
This should help maintaining vim-plugins outside of nixpkgs, as one can
use update.py to generate an out-of-tree vimPlugins overlay.
there was a 404 error, having basic logging makes it easier to troubleshoot
@teto
Copy link
Member Author

teto commented May 16, 2021

Going ahead to avoid countless rebasing. I will update the manual once nix stops crashing.

@teto teto merged commit 9d4a851 into NixOS:master May 16, 2021
@teto teto deleted the vimPlugins_rework branch May 16, 2021 23:17
@Mic92
Copy link
Member

Mic92 commented May 17, 2021

I think the following overlay should work

final: prev: {
          vimPlugins = prev.vimPlugins.extend (
            final2: prev2: {
              octo-nvim = prev.buildVimPluginFrom2Nix {
                pname = "octo-nvim";
                version = "2021-05-06";
                src = prev.fetchFromGitHub {
                  owner = "pwntester";
                  repo = "octo.nvim";
                  rev = "d92a7352516f06a457cbf8812b173abc319f7882";
                  sha256 = "1xvj3p32nzcn8rv2hscmj8sn8bfm1s2r5j1cwwnkl4zbqdbd4k5f";
                };
                meta.homepage = "https://github.com/pwntester/octo.nvim/";
              };
            }

          );
        };

but as soon as I uncomment it nix crashes:
/run/current-system/sw/bin/nixos-rebuild: line 474: 2329477 Segmentation fault (core dumped) nix "${flakeFlags[@]}" build "$flake#$flakeAttr.config.system.build.toplevel" "${extraBuildFlags[@]}" "${lockFlags[@]}".
So I would be tempted to merge now and I will add the doc once those crashes go away ?

Maybe a stackoverflow (because of infinite recursion)?

@teto
Copy link
Member Author

teto commented Jun 30, 2021

@Mic92 it works now, I've opened #126633

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants