{ description = "virtual environment with Rstudio, R, Shiny";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
rWrapper=pkgs.rWrapper;
rstudioWrapper=pkgs.rstudioWrapper;
rstudioServerWrapper=pkgs.rstudioServerWrapper;
Rpackages=with pkgs.rPackages;[
shiny
data.table
];
RwithPackages= rWrapper.override{ packages = Rpackages;};
RStudio-with-my-packages = rstudioWrapper.override{ packages = Rpackages; };
myDevTools = [
#qtbase #patch
RwithPackages
RStudio-with-my-packages
];
in {
devShells.default = pkgs.mkShell {
buildInputs = myDevTools;
};
}); }
This doesn't work
error: undefined variable 'data'
the problem is that nix doesn't accept name with . in the middle. The package data.table has been stored under another name.
How to find it
If somebody has a quicker solution, please say it.
This work but this is a little cubersome.
All nix packages are defined there:
search rpackage in this file
use the github search bar with development/r-modules cran-package looks like a good match https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/r-modules/cran-packages.nix
search for data.table
This line give the information. Now it should work