-
-
Notifications
You must be signed in to change notification settings - Fork 294
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
flake/dev: add nixvim-init command (under 'init' shell command) #2468
base: main
Are you sure you want to change the base?
Conversation
b62ef90
to
7ab035c
Compare
@@ -0,0 +1,3 @@ | |||
fn main() { | |||
println!("Hello, world!"); |
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.
oooh we doin rust now :)
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.
I'm a huge noob, but I just want to do a simple nix-init
clone for nixvim.
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.
Not opposed to learning a bit of rust for this, just conscious I already have to improve my python to properly be capable of maintaining our other in-tree scripts... 😅
pname = "nixvim-init"; | ||
version = "nightly"; | ||
|
||
src = ./.; |
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.
Generally, src = ./.
is a bad idea because default.nix
itself will also be considered a "source" of the derivation.
This means if default.nix
is modified, the derivation needs to be rebuilt. Even if no source actually changed and the change to the nix file wouldn't actually need a rebuild.
Usually, you'd do something like src = ./src
. I think you could also use a fileset or filtered source to filter out nix files, but those options seem a little overkill.
That said, this is a minor issue and we're already doing this in most of our other derivations, so it shouldn't block the PR if you'd rather keep it as-is.
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.
Ok, very good to know.
Considering the simplicity of this application, I don't think that we should overthink it.
Neither the rust code itself or the default.nix
will be modified too often.
Also, I expect the build time to be ridiculously short.
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.
I still prefer having sources and nix files separate, (I don't think it has any downsides?), but I won't press on the issue.
edition = "2021" | ||
|
||
[dependencies] | ||
clap = "4.5.20" |
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.
I'd suggest using clap = { version = "4.5.20", features = ["derive"] }
, it's quite a bit more ergonomic
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.
Ok thanks ! Actually, I don't even think that we will need clap at all.
Good to know though.
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.
Actually, I don't even think that we will need clap at all.
I think we'll probably end wanting some decent argument parsing and help-text at some point...
Even if we have a mostly interactive UX it'd still be nice to be able to do things via CLI args.
A small helper to quickly add a new plugin.
This is inspired from nix-init.
It will be a small interactive program that prompts the name of the plugin, the package name and that will initialize the module and test files.
plugins/by-name/<NAME>/default.nix
mkVimPlugin
supportmkNeovimPlugin
supporttests/test-sources/plugins/by-name/<NAME>/default.nix