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

Ship a default.nix via inst/extdata? #14

Closed
philipp-baumann opened this issue Aug 3, 2023 · 18 comments
Closed

Ship a default.nix via inst/extdata? #14

philipp-baumann opened this issue Aug 3, 2023 · 18 comments

Comments

@philipp-baumann
Copy link
Collaborator

I thought this might be useful for windows. Basically one could just include "R" version plus {rix} dev version from github. @b-rodrigues what do you think?

@philipp-baumann
Copy link
Collaborator Author

#6

@philipp-baumann
Copy link
Collaborator Author

philipp-baumann commented Aug 3, 2023

It is mostly to avoid cyclic dependencies, since one can only run rix::rix() after installation unless doing some magic parsing tricks ;-)

@philipp-baumann
Copy link
Collaborator Author

the other option would be to provide a helper in R, that can be sourced from base R.

@philipp-baumann
Copy link
Collaborator Author

@b-rodrigues aaah rix::rix() is only using base R, so easy to do.

@b-rodrigues
Copy link
Contributor

I don't understand what you're suggesting?

@philipp-baumann
Copy link
Collaborator Author

philipp-baumann commented Aug 3, 2023

ok sorry for being unclear. I thought it would be useful on Win or WSL2, respectively, to install and use rix easily. For this, one could use a default .nix file. Is the intention clear?

@philipp-baumann
Copy link
Collaborator Author

philipp-baumann commented Aug 3, 2023

ok sorry for being unclear. I thought it would be useful on Win or WSL2, respectively, to install and use rix easily. For this, one could use a default .nix file. Is the intention clear?

mainly because the package depends on httr and curl, which require system commands. With nix, it is really straight-forward to bootstrap without also first installing GNU compiler toolchain via apt (at least WSL2 does not give that by default).

@philipp-baumann
Copy link
Collaborator Author

philipp-baumann commented Aug 3, 2023

The disadvantage is of course that one has to manually update (nixpkgs version, R version etc.), if one would go through external data. That would maybe speak for a helper.

@b-rodrigues
Copy link
Contributor

Ah I got it now, sorry! But wouldn't users need to be able to install the package in the first place to get access to inst/default.nix? Which is why I wrote that section in the vignette

https://b-rodrigues.github.io/rix/articles/interactive-use.html#scenario-2-you-install-r-and-rstudio-using-nix

@philipp-baumann
Copy link
Collaborator Author

Ah I got it now, sorry! But wouldn't users need to be able to install the package in the first place to get access to inst/default.nix? Which is why I wrote that section in the vignette

https://b-rodrigues.github.io/rix/articles/interactive-use.html#scenario-2-you-install-r-and-rstudio-using-nix

true, but one can also just cat to nix-build in bash, right?

@philipp-baumann
Copy link
Collaborator Author

aah now also getting, you are right, cat'ing inst/extdata/default.nix would make sense.

@philipp-baumann
Copy link
Collaborator Author

philipp-baumann commented Aug 3, 2023

@

Ah I got it now, sorry! But wouldn't users need to be able to install the package in the first place to get access to inst/default.nix? Which is why I wrote that section in the vignette

https://b-rodrigues.github.io/rix/articles/interactive-use.html#scenario-2-you-install-r-and-rstudio-using-nix

thanks for pointing to that resource. That is actually sufficient for the README, so I will just PR add the link, ok?

@b-rodrigues
Copy link
Contributor

yes that’d be great, and you are right as well, we could put that script in inst/ext and then have users run

nix-shell https://github.com/b-rodrigues/rix/master/inst/extdata/default.nix

which I believe should drop them in a nix-shell with R and rix installed, so from there they could start building new default.nix files and work from there. What do you think?

@philipp-baumann
Copy link
Collaborator Author

yes that’d be great, and you are right as well, we could put that script in inst/ext and then have users run

nix-shell https://github.com/b-rodrigues/rix/master/inst/extdata/default.nix

which I believe should drop them in a nix-shell with R and rix installed, so from there they could start building new default.nix files and work from there. What do you think?

I like that approach! Let me draft so users can tap like this. 💯

@b-rodrigues
Copy link
Contributor

But let's make clear that rix can be used even if nix is not installed, so windows users could install rix on windows (and the dependencies would be easily installed, because binaries for Windows are available) and generate default.nix files that they could then build with Nix on WSL2 or on another machine with Nix available

@philipp-baumann
Copy link
Collaborator Author

But let's make clear that rix can be used even if nix is not installed, so windows users could install rix on windows (and the dependencies would be easily installed, because binaries for Windows are available) and generate default.nix files that they could then build with Nix on WSL2 or on another machine with Nix available

yes, good point.

@philipp-baumann
Copy link
Collaborator Author

Generally like the restructuring. The only thing I thought was that maybe the part after the intro in the Readme could be a bit crispier in terms of lengh 🚀

@b-rodrigues
Copy link
Contributor

done

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

No branches or pull requests

2 participants