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

editors/nvim: fix missing example folder issue in remote testing #450

Merged
merged 1 commit into from
Apr 24, 2024
Merged

editors/nvim: fix missing example folder issue in remote testing #450

merged 1 commit into from
Apr 24, 2024

Conversation

Ruixi-rebirth
Copy link
Member

@Ruixi-rebirth Ruixi-rebirth commented Apr 23, 2024

No description provided.

@Ruixi-rebirth Ruixi-rebirth changed the title flake.nix(devShell.nvim): fix missing test folder issue in remote tes… flake.nix(devShell.nvim): fix missing test folder issue in remote testing Apr 23, 2024
@Ruixi-rebirth Ruixi-rebirth changed the title flake.nix(devShell.nvim): fix missing test folder issue in remote testing flake.nix(devShells.nvim): fix missing test folder issue in remote testing Apr 23, 2024
@Ruixi-rebirth Ruixi-rebirth requested a review from inclyc as a code owner April 23, 2024 20:09
@inclyc inclyc changed the title flake.nix(devShells.nvim): fix missing test folder issue in remote testing editors/nvim: fix missing test folder issue in remote testing Apr 24, 2024
Copy link
Member

@inclyc inclyc left a comment

Choose a reason for hiding this comment

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

fix missing test folder issue in remote testing

What is 'remote testing' and what is exactly 'missing test folder' issue?

@Ruixi-rebirth
Copy link
Member Author

fix missing test folder issue in remote testing

What is 'remote testing' and what is exactly 'missing test folder' issue?

'remote testing': the nvim test environment defined by the remote repository
'missing test folder': ./nixd/docs/examples/NixOS_Home-Manager/*

When I pull the necessary definitions from the remote repository and create the nvim test environment I get the following problem:

image

So I've added a way to handle this: when it can't find the example folder locally, it pulls this test example from the git repo

image

@inclyc inclyc changed the title editors/nvim: fix missing test folder issue in remote testing editors/nvim: fix missing example folder issue in remote testing Apr 24, 2024
Copy link
Member

@inclyc inclyc left a comment

Choose a reason for hiding this comment

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

I see. However looks like you are trying to use the flake to setup nixos + home-manager options, why not write builtins.fetchTarball-like expressions in the neovim, so thus you don't need to do such "fetching flake to /tmp" ugly stuff.

"expr": "builtins.fetchTarball ..." 

@Ruixi-rebirth
Copy link
Member Author

Oh, I got it.

@inclyc
Copy link
Member

inclyc commented Apr 24, 2024

Note that fetchTarball might be relatively slow thus the completion will not pop immediately, which may affect end-user experience. (I'd like to suggest not writing any "fetchers" stuff at all, just using default <nixpkgs> will be decent.

Document how to write home-manager configuration, and separate a new "devShell" dedicated for home-manager ?

@Ruixi-rebirth
Copy link
Member Author

In terms of how to configure it, I don't think it's necessary to start another devShell on how to write a home-manager configuration. The purpose of the devShells.nvim configuration here is one thing: to experience the beauty of nixd in the easiest way possible for the user.

Although the current way of pulling the examples directory from the repository is ugly, the fact that users can use our examples locally makes it very easy for them to experience the power of nixd.

@inclyc
Copy link
Member

inclyc commented Apr 24, 2024

the fact that users can use our examples locally

During the first time nixd lauches, the flake inputs will be fetched from the internet, this is rather slow. Run nix store gc and then launch the editor environment may reproduce this issue

@Ruixi-rebirth
Copy link
Member Author

If so,then we can tell the user when we start the editor that nixd will be slow the first time we start it.

@inclyc
Copy link
Member

inclyc commented Apr 24, 2024

If so,then we can tell the user when we start the editor that nixd will be slow the first time we start it.

Okay, I agree.

@Ruixi-rebirth Ruixi-rebirth merged commit ba9f66a into nix-community:main Apr 24, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants