b-rodrigues / rix

Reproducible development environments for R with Nix
https://b-rodrigues.github.io/rix/
GNU General Public License v3.0
102 stars 11 forks source link

Docs: install rix with with default.nix, not install.packages() #155

Closed artur-sannikov closed 2 months ago

artur-sannikov commented 2 months ago

Hi,

I was following this guide to install rix. I noticed that after we download default.nix and then run rix() command, default.nix is overwritten (overwrite = TRUE), which obviously removes rix after nix-build.

I think, rix should be always specified in default.nix as it's the goal of the project to use nix-build for completely reproducible environments. Using

install.packages("rix", repos = [c](https://rdrr.io/r/base/c.html)("https://b-rodrigues.r-universe.dev",
  "https://cloud.r-project.org"))

from the R session partially defeats this purpose.

A better rix() command might look like this:

rix(r_ver = "latest",
    r_pkgs = c("dplyr", "ggplot2"),
    git_pkgs = list(package_name = "rix",
                   repo_url = "https://github.com/b-rodrigues/rix",
                   branch_name = "master",
                   commit = "76d1bdd03d78589d399b4b9d473ecde616920a82"),
    ide = "other",
    project_path = ".",
    overwrite = TRUE)
b-rodrigues commented 2 months ago

Thanks! This was indeed confusing. I believe it should be better now. Could you take a look at PR https://github.com/b-rodrigues/rix/pull/157 ?