Skip to content

Commit

Permalink
Merge pull request #38 from nueidris/R
Browse files Browse the repository at this point in the history
Add R environment
  • Loading branch information
lucperkins committed Jun 22, 2024
2 parents 46a3673 + f47b72e commit cd76d64
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ Once your preferred template has been initialized, you can use the provided shel
| [Protobuf] | [`protobuf`](./protobuf/) |
| [Pulumi] | [`pulumi`](./pulumi/) |
| [Purescript] | [`purescript`](./purescript/) |
| [R] | [`r`](./r/) |
| [Ruby] | [`ruby`](./ruby/) |
| [Rust] | [`rust`](./rust/) |
| [Scala] | [`scala`](./scala/) |
Expand Down Expand Up @@ -249,6 +250,12 @@ A dev template that's fully customizable.
- [Python] 3.11.4
- [pip] 23.0.1

### [`r`](./r/)

- [R] 4.3.1
- [rmarkdown] 2.22
- [knitr] 1.43 ([pandoc] and [texlive])

### [`ruby`](./ruby/)

- [Ruby] 3.2.2, plus the standard Ruby tools (`bundle`, `gem`, etc.)
Expand Down Expand Up @@ -342,6 +349,7 @@ All of the templates have only the root [flake](./flake.nix) as a flake input. T
[java]: https://java.com
[jdtls]: https://projects.eclipse.org/projects/eclipse.jdt.ls
[jq]: https://jqlang.github.io/jq
[knitr]: https://yihui.org/knitr/
[kotlin]: https://kotlinlang.org
[latex]: https://www.latex-project.org/
[lcov]: https://ltp.sourceforge.net/coverage/lcov.php
Expand Down Expand Up @@ -371,6 +379,7 @@ All of the templates have only the root [flake](./flake.nix) as a flake input. T
[odoc]: https://github.com/ocaml/odoc
[omnisharp-roslyn]: https://github.com/OmniSharp/omnisharp-roslyn
[opa]: https://openpolicyagent.org
[pandoc]: https://pandoc.org/
[packer]: https://packer.io
[pip]: https://pypi.org/project/pip
[phoenix]: https://phoenixframework.org
Expand All @@ -382,7 +391,9 @@ All of the templates have only the root [flake](./flake.nix) as a flake input. T
[purescript-language-server]: https://github.com/nwolverson/purescript-language-server
[purs-tidy]: https://github.com/natefaubion/purescript-tidy
[python]: https://python.org
[r]: https://www.r-project.org/
[release]: https://github.com/NixOS/nixpkgs/releases/tag/22.11
[rmarkdown]: https://rmarkdown.rstudio.com/
[ruby]: https://ruby-lang.org
[rust]: https://rust-lang.org
[rust-analyzer]: https://rust-analyzer.github.io
Expand Down
5 changes: 5 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,11 @@
description = "Python development environment";
};

r = {
path = ./r;
description = "R development environment";
};

ruby = {
path = ./ruby;
description = "Ruby development environment";
Expand Down
1 change: 1 addition & 0 deletions r/.envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
27 changes: 27 additions & 0 deletions r/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 31 additions & 0 deletions r/flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
description = "A Nix-flake-based R development environment";

inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.*.tar.gz";

outputs = { self, nixpkgs }:
let
overlays = [
(final: prev: rec {
rEnv = prev.rWrapper.override {
packages = with prev.rPackages; [ knitr ];
};
})
];
supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
pkgs = import nixpkgs { inherit overlays system; };
});
in
{
devShells = forEachSupportedSystem ({ pkgs }: {
default = pkgs.mkShell {
packages = with pkgs;
[ rEnv
pandoc
texlive.combined.scheme-full
];
};
});
};
}

0 comments on commit cd76d64

Please sign in to comment.