The simplest way to run this is use nix develop
:
nix develop github:PhDyellow/nix_r_dev_shell#devShells."x86_64-linux".r-shell
For reproducibility, specify the git commit hash:
nix develop github:PhDyellow/nix_r_dev_shell/e14ac6840c7cb813b3c086e7526435aef613f050#devShells."x86_64-linux".r-shell
For pinning so nix store gc
doesn’t delete all the software, either use direnv, or nix build
.
For direnv:
- Install
direnv
on your system - add a file named
.envrc
in a directory where this R shell will be used with the following contentsuse flake github:PhDyellow/nix_r_dev_shell/e14ac6840c7cb813b3c086e7526435aef613f050#r-shell
cd
to the folder and typedirenv allow
- Once it is done building, R will be available to any shell that is inside the folder, and
nix store gc
will not delete the R environment
- Once it is done building, R will be available to any shell that is inside the folder, and
For nix build
, go to a folder where you can leave a symlink, probably your home directory, and run:
nix build --print-out-paths github:PhDyellow/nix_r_dev_shell/dc0d948b1fd6c49bd4ba4c61e86ce90b19b37e30#devShells.x86_64-linux.r-shell
Ensure the option --no-link
is NOT specified, the link is what stops nix store gc
from deleting the R environment.