ropensci / rix

Reproducible development environments for R with Nix
https://docs.ropensci.org/rix/
GNU General Public License v3.0
136 stars 12 forks source link

Use best practices to generate default.nix files #59

Closed b-rodrigues closed 1 year ago

b-rodrigues commented 1 year ago

https://nix.dev/recipes/best-practices

b-rodrigues commented 1 year ago

What do you think @philipp-baumann ? See: https://github.com/b-rodrigues/rix/blob/rix_rewrite/inst/extdata/default.nix

There's more repetition but it's according to best practices. Is there a way to avoid repeating library calls so much?

b-rodrigues commented 1 year ago

I've also removed the rwrapper, I'm not sure why it's needed? I remember discussing this with Justin but don't remember the discussion need to ask him again :smile:

b-rodrigues commented 1 year ago

ok so continuing to experiment with and without the wrapper and it's definitely needed, without it, another version of R and package set gets picked up. So I've added it back, but now I'm wondering if the fact that rix gets built "outside" of the rWrapper might be a problem?

philipp-baumann commented 1 year ago

What do you think @philipp-baumann ? See: https://github.com/b-rodrigues/rix/blob/rix_rewrite/inst/extdata/default.nix

There's more repetition but it's according to best practices. Is there a way to avoid repeating library calls so much?

very much like this initiative. Which library calls you mean? I am beginner with the nix language, therefore not sure if I can help. But it is a good exercise.

philipp-baumann commented 1 year ago

I've also removed the rwrapper, I'm not sure why it's needed? I remember discussing this with Justin but don't remember the discussion need to ask him again 😄

good idea :-) same for me don't know.

b-rodrigues commented 1 year ago

I mean I need to write a lot of pkgs. to refer to certain and also pkgs.rPackages.... I'm trying to rewrite it now, don't know if I'll be successfull :D

philipp-baumann commented 1 year ago

@b-rodrigues one other thing I stumbled upon. It would be nice to have a setup without r_pkgs, i.e. a plain R one with core CRAN packages only. Currently, it errors when we do not supply this argument in rix::rix().

b-rodrigues commented 1 year ago

fixed with ae39d2142461688b1be41db800752a949ebb3c7b

@b-rodrigues one other thing I stumbled upon. It would be nice to have a setup without r_pkgs, i.e. a plain R one with core CRAN packages only. Currently, it errors when we do not supply this argument in rix::rix().

this should also work now