From 06155ede1b5504c3b5319a9da3fa8f02b08f4e68 Mon Sep 17 00:00:00 2001 From: Daniel Winkler Date: Fri, 12 Sep 2025 21:05:07 +1000 Subject: [PATCH] Added usage example --- README.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..bc46a94 --- /dev/null +++ b/README.md @@ -0,0 +1,37 @@ +# Usage + +Based on [the-nix-way](https://github.com/the-nix-way/dev-templates) + +```flake.nix +{ + description = "A Nix-flake-based R development environment"; + + inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1"; + inputs.fran.url = "github:dwinkler1/fran"; + inputs.fran.inputs.nixpkgs.follows = "nixpkgs"; + + outputs = inputs: let + supportedSystems = ["x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin"]; + forEachSupportedSystem = f: + inputs.nixpkgs.lib.genAttrs supportedSystems (system: + f { + pkgs = import inputs.nixpkgs { + inherit system; + overlays = [inputs.fran.overlays.default]; + }; + }); + mkR = inputs.fran.lib.mkR; + in { + devShells = forEachSupportedSystem ({pkgs}: { + default = pkgs.mkShell { + packages = with pkgs; [ + (mkR { + inherit pkgs; + packages = [rPackages.data_table extraRPackages.fwildclusterboot]; + }) + ]; + }; + }); + }; +} +```