Skip to content

Commit

Permalink
some doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Bruno Rodrigues committed Jul 28, 2023
1 parent c8e41d3 commit 0ac9bfa
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 12 deletions.
28 changes: 21 additions & 7 deletions dev/building_envs_with_rix.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,24 @@ editor_options:
chunk_output_type: console
---

Basic usage:

```{r, eval = F}
The goal of `{rix}` is to provide an easy way to generate `default.nix` files.
These files used by the Nix package manager to build an environment according to
the instructions found in the `default.nix` file. Users can specify which
version of R, R packages, other needed software, IDE etc should be available
within that environment. Writing such files can be daunting for newcomers, as so
`{rix}` provides a function called `rix()`, which generates such a file.

Users need to provide the following inputs to `rix()`:

- `r_ver`: the version of R required. Use "current" for the latest version;
- `r_pkgs`: the required R packages. For example "dplyr";
- `other_pkgs`: the required system packages, if needed. For example "quarto", or a Python interpreter;
- `git_pkgs`: list of git packages to add. See the example below;
- `ide`: the integrated development editor to use. For example "rstudio" if you want to use RStudio. Refer to the "Interactive work with {rix}" for more details;
- `path`: the path where to save the `default.nix` file.
- `overwrite`: whether to overwrite the `default.nix` file or not.

```{r}
path_default_nix <- tempdir()
rix(r_ver = "4.2.1",
Expand All @@ -21,13 +35,13 @@ rix(r_ver = "4.2.1",
```

```{r, eval = F}
```{r}
cat(readLines(paste0(path_default_nix, "/default.nix")), sep = "\n")
```

Specifying a package on Github:

```{r, eval = F}
```{r}
rix(r_ver = "4.2.1",
r_pkgs = c("dplyr", "janitor"),
other_pkgs = c("quarto"),
Expand All @@ -41,6 +55,6 @@ rix(r_ver = "4.2.1",
```

```{r, eval = F}
```{r}
cat(readLines(paste0(path_default_nix, "/default.nix")), sep = "\n")
```
24 changes: 19 additions & 5 deletions vignettes/building_envs_with_rix.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,25 @@ library(rix)

<!-- WARNING - This vignette is generated by {fusen} from dev/building_envs_with_rix.Rmd: do not edit by hand -->

Basic usage:
The goal of `{rix}` is to provide an easy way to generate `default.nix` files.
These files used by the Nix package manager to build an environment according to
the instructions found in the `default.nix` file. Users can specify which
version of R, R packages, other needed software, IDE etc should be available
within that environment. Writing such files can be daunting for newcomers, as so
`{rix}` provides a function called `rix()`, which generates such a file.

Users need to provide the following inputs to `rix()`:

```{r eval = F}
- `r_ver`: the version of R required. Use "current" for the latest version;
- `r_pkgs`: the required R packages. For example "dplyr";
- `other_pkgs`: the required system packages, if needed. For example "quarto", or a Python interpreter;
- `git_pkgs`: list of git packages to add. See the example below;
- `ide`: the integrated development editor to use. For example "rstudio" if you want to use RStudio. Refer to the "Interactive work with {rix}" for more details;
- `path`: the path where to save the `default.nix` file.
- `overwrite`: whether to overwrite the `default.nix` file or not.


```{r}
path_default_nix <- tempdir()
rix(r_ver = "4.2.1",
Expand All @@ -37,14 +51,14 @@ rix(r_ver = "4.2.1",
```

```{r eval = F}
```{r}
cat(readLines(paste0(path_default_nix, "/default.nix")), sep = "\n")
```

Specifying a package on Github:


```{r eval = F}
```{r}
rix(r_ver = "4.2.1",
r_pkgs = c("dplyr", "janitor"),
other_pkgs = c("quarto"),
Expand All @@ -58,7 +72,7 @@ rix(r_ver = "4.2.1",
```

```{r eval = F}
```{r}
cat(readLines(paste0(path_default_nix, "/default.nix")), sep = "\n")
```

0 comments on commit 0ac9bfa

Please sign in to comment.