How to install RStudio (wrapper) packages declaratively?

Amazing! It worked!

For future NixOS and RStudio users, here’s what I ended up with in the environment.systemPackages =… part of my configuration.nix file (of course, your personal packages will vary depending on what you work with):

  # List packages installed in system profile. To search, run:
  # $ nix search wget
#  let
#    R-with-my-packages = rstudioWrapper.override{ packages = with rPackages; [ snakecase ]; };
#  in
  environment.systemPackages = with pkgs;
  let
    RStudio-with-my-packages = rstudioWrapper.override{
      packages = with rPackages; [ tidyverse snakecase ]; };
  in
  [
    neovim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
    RStudio-with-my-packages
    other-programs-you-want-to-install
  ];

Thank you, @jbedo and @TLATER. I marked this as the solution so that the final result appears at the top, but as to credit, you two got me closer to the answer! I hope this way of marking a solution is okay. Otherwise please let me know :slight_smile:

1 Like