I want an R interpreter installed with a set of packages that is accessible globally on my system.
- I know I can install R globally via
nix profile install nixpkgs#R nixpkgs#rPackages.ggplot2, but this doesn’t have any dependencies likeggplot2accessible from the R shell - I know I can get a
nix-shellof this using a command like what is shown in the nix docs:
nix-shell --packages 'rWrapper.override{packages = [ rPackages.ggplot2 ];}'
- I know I can
nix developinto an environment like this using the followingflake.nixfile:
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs =
{
self,
nixpkgs,
}:
let
system = "aarch64-darwin";
pkgs = import nixpkgs { inherit system; };
in
{
default = pkgs.mkShell {
buildInputs = with pkgs; [
(rWrapper.override {
packages = with pkgs.rPackages; [
ggplot2
];
})
];
};
};
}
→ now how do I install R globally with nix profile install to get this kind of install to live globally on my system (under some profile)?