feat(flake): expose nvimcom as a standalone package output - #616
Conversation
PMassicotte
left a comment
There was a problem hiding this comment.
Thanks for adding this! Two small nits on the new packages.nvimcom derivation:
-
gcc and gnumake should go in nativeBuildInputs, not buildInputs. The packages.default build one commit earlier (#615) already does this correctly (nativeBuildInputs = [pkgs.gnumake pkgs.gcc]), and it matches nixpkgs convention, build-time tools belong in nativeBuildInputs so cross-compilation resolves them for the build platform rather than the host platform. Works fine natively (which is why it builds today), but would break under cross-compilation.
-
R doesn't need to be listed explicitly in buildInputs. pkgs.rPackages.buildRPackage (nixpkgs' generic-builder.nix) already unconditionally prepends R to buildInputs, so this entry is redundant.
Suggested fix:
packages.nvimcom = pkgs.rPackages.buildRPackage {
name = "nvimcom";
src = ./nvimcom;
nativeBuildInputs = with pkgs; [
gcc
gnumake
];
};|
Thanks for the feedback! I should've checked upstream beforehand, sorry about that! packages = let
buildTools = with pkgs; [gnumake gcc];
in {
# Optional: Add a package for R.nvim itself
default = pkgs.vimUtils.buildVimPlugin {
pname = "R.nvim";
version = "1.0.0";
src = ./.;
nativeBuildInputs = buildTools;
buildPhase = ''
runHook preBuild
make -C rnvimserver
runHook postBuild
'';
};
# Separate nvimcom R package
nvimcom = pkgs.rPackages.buildRPackage {
name = "nvimcom";
version = "0.9.96";
src = ./nvimcom;
nativeBuildInputs = buildTools;
};
};I could also move the |
|
This looks good, thanks for the thorough follow-up! The Aslo, I do not think that we need to touch the What do you think? |
|
Let me know when all is ready for merging! |
Adds opt-in flake output for users who want to manage nvimcom declaratively through Nix. `packages` is restructured to share a common `nativeBuildInputs` binding and versions are bumped.
84139ac to
6c1c150
Compare
|
I've squashed the fixup commit into the original for a cleaner history before merge. I'd say it's ready👍. |
|
Thank you very much! |
As mentioned in #615 , this PR would add an opt-in flake output for users who also want to manage
nvimcomdeclaratively through Nix. For example, baked into aset ahead of time. This is particularly useful for use with
rixwhich doesn't allow installing R packages at runtime.Depending on how the input is defined, it would be consumed via:
Best,
Neurarian