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: add config to passthru #101100

Merged
merged 1 commit into from Oct 20, 2020
Merged

neovim: add config to passthru #101100

merged 1 commit into from Oct 20, 2020

Conversation

@teto
Copy link
Contributor

@teto teto commented Oct 19, 2020

  • register the config in the store under the name init.vim which is more
    appropriate for neovim.
  • generated config added to passthru so that one can easily pass the current config to a raw/unwrapped neovim (helps with development).

For instance, home-manager could reference the config in $XDG_CONFIG_HOME/nvim/init.vim
without the need to wrap nvim with a --cmd.

I develop on neovim and I would like to run the raw binary with the nix generated config but because it keeps changing name it's not always easy. This adds an easy way out.

cc @timokau

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 requested a review from jonringer as a code owner Oct 19, 2020
@ofborg ofborg bot added the 6.topic: vim label Oct 19, 2020
Copy link
Member

@timokau timokau left a comment

ofBorg eval fails, but other than that looks good to me 👍

pkgs/applications/editors/neovim/wrapper.nix Outdated Show resolved Hide resolved
first will register the config under the name init.vim which is more
appropriate for neovim.
Pass the generated config to passthru so that one can easily pass the
current config to a
raw/unwrapped neovim (helps with development).

For instance, home-manager can reference the config in $XDG_CONFIG_HOME/nvim/init.vim
without the need to wrap nvim with its config.
@teto teto force-pushed the teto:neovim_module2 branch from e31ee2b to 4b3322a Oct 20, 2020
@teto
Copy link
Contributor Author

@teto teto commented Oct 20, 2020

thnaks for the review. I had forgotten to cherry-pick some changes from my fork of nixpkgs. It should be good now.

@teto
Copy link
Contributor Author

@teto teto commented Oct 20, 2020

actually hold on I might have a better idea than this PR. will reopen when I sort it out.

EDIT: the alternative looks a bit complex so I will postpone it.

@teto teto closed this Oct 20, 2020
@teto teto reopened this Oct 20, 2020
@teto teto merged commit 4c4c487 into NixOS:master Oct 20, 2020
17 of 18 checks passed
17 of 18 checks passed
@github-actions
tests
Details
@github-actions
tests
Details
@github-actions
action
Details
@github-actions
action
Details
@github-actions
Wait for ofborg This failed status will be cleared when ofborg finishes eval.
Details
@ofborg
Evaluation Performance Report Evaluator Performance Report
Details
@ofborg
grahamcofborg-eval ^.^!
Details
@ofborg
grahamcofborg-eval-check-meta config.nix: checkMeta = true
Details
@ofborg
grahamcofborg-eval-darwin nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="4b3322a"; rev="4b3322a09c6caffea574744890eb6b367fa0284f"; } ./pkgs/t
Details
@ofborg
grahamcofborg-eval-lib-tests nix-build --arg pkgs import ./. {} ./lib/tests/release.nix
Details
@ofborg
grahamcofborg-eval-nixos nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="4b3322a"; rev="4b3322a09c6caffea574744890eb6b367fa0284f"; } ./nixos/
Details
@ofborg
grahamcofborg-eval-nixos-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="4b3322a"; rev="4b3322a09c6caffea574744890eb6b367fa0284f"; } ./nixos/
Details
@ofborg
grahamcofborg-eval-nixos-options nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="4b3322a"; rev="4b3322a09c6caffea574744890eb6b367fa0284f"; } ./nixos/
Details
@ofborg
grahamcofborg-eval-nixpkgs-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="4b3322a"; rev="4b3322a09c6caffea574744890eb6b367fa0284f"; } ./pkgs/t
Details
@ofborg
grahamcofborg-eval-nixpkgs-tarball nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="4b3322a"; rev="4b3322a09c6caffea574744890eb6b367fa0284f"; } ./pkgs/t
Details
@ofborg
grahamcofborg-eval-nixpkgs-unstable-jobset nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="4b3322a"; rev="4b3322a09c6caffea574744890eb6b367fa0284f"; } ./pkgs/t
Details
@ofborg
grahamcofborg-eval-package-list nix-env -qa --json --file .
Details
@ofborg
grahamcofborg-eval-package-list-no-aliases nix-env -qa --json --file . --arg config { allowAliases = false; }
Details
@teto teto deleted the teto:neovim_module2 branch Oct 20, 2020
@teto
Copy link
Contributor Author

@teto teto commented Oct 20, 2020

the problem (in my usage etc) is that the wrapper writes the file. I am preparing a PR with a function genNeovimConfig that returns { wrapperFlags, rcContent } so that the caller can choose wether or not to wrap neovim with -u init.vim (which breaks neovim behavior and is not necessary in home-manager, which could write the file in ~/.config/nvim/init.vim

@teto
Copy link
Contributor Author

@teto teto commented Oct 20, 2020

finally got my genNeovimConfig working \o/ will post after cleanup (this WE ?). Got it integrated with my home-manager fork and the experience is much more pleasant.

sdier added a commit to sdier/nixpkgs that referenced this pull request Oct 23, 2020
first will register the config under the name init.vim which is more
appropriate for neovim.
Pass the generated config to passthru so that one can easily pass the
current config to a
raw/unwrapped neovim (helps with development).

For instance, home-manager can reference the config in $XDG_CONFIG_HOME/nvim/init.vim
without the need to wrap nvim with its config.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants