From 6b828ee1812efa96911006f7fabda099d45e1f94 Mon Sep 17 00:00:00 2001 From: Jacob Wujciak-Jens Date: Tue, 14 May 2024 23:57:58 +0200 Subject: [PATCH] use nix --- scripts/bm-report/default.nix | 58 +++++++++++++++++++++++++++++++++++ scripts/bm-report/report.Rmd | 2 +- 2 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 scripts/bm-report/default.nix diff --git a/scripts/bm-report/default.nix b/scripts/bm-report/default.nix new file mode 100644 index 0000000000000..335a9e5f24cfe --- /dev/null +++ b/scripts/bm-report/default.nix @@ -0,0 +1,58 @@ +# This file was generated by the {rix} R package v0.6.0 on 2024-05-14 +# with following call: +# >rix::rix(r_ver = "abd6d48f8c77bea7dc51beb2adfa6ed3950d2585", +# > r_pkgs = install.packages(c("dplyr", +# > "prettyunits", +# > "ggplot2", +# > "gh", +# > "gt", +# > "hms", +# > "jqr", +# > "jsonlite", +# > "lubridate", +# > "memoise", +# > "plotly", +# > "purrr", +# > "remotes")), +# > system_pkgs = c("quarto"), +# > git_pkgs = list(package_name = "conbenchcoms", +# > repo_url = "https://github.com/conbench/conbenchcoms", +# > branch_name = "main", +# > commit = "55cdb120bbe2c668d3cf8ae543f4922131653645"), +# > ide = "other", +# > project_path = path_default_nix, +# > overwrite = TRUE, +# > print = TRUE) +# It uses nixpkgs' revision abd6d48f8c77bea7dc51beb2adfa6ed3950d2585 for reproducibility purposes +# which will install R version latest +# Report any issues to https://github.com/b-rodrigues/rix +let + pkgs = import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/abd6d48f8c77bea7dc51beb2adfa6ed3950d2585.tar.gz") {}; + git_archive_pkgs = [(pkgs.rPackages.buildRPackage { + name = "conbenchcoms"; + src = pkgs.fetchgit { + url = "https://github.com/conbench/conbenchcoms"; + branchName = "main"; + rev = "55cdb120bbe2c668d3cf8ae543f4922131653645"; + sha256 = "sha256-XR5+grCUKyvSxsqiOkKd3gMUsWDJblZDmF4O+Jehq6U="; + }; + propagatedBuildInputs = builtins.attrValues { + inherit (pkgs.rPackages) dplyr glue httr2 yaml; + }; + }) ]; + system_packages = builtins.attrValues { + inherit (pkgs) R glibcLocales nix quartoMinimal which; +}; + in + pkgs.mkShell { + LOCALE_ARCHIVE = if pkgs.system == "x86_64-linux" then "${pkgs.glibcLocales}/lib/locale/locale-archive" else ""; + LANG = "en_US.UTF-8"; + LC_ALL = "en_US.UTF-8"; + LC_TIME = "en_US.UTF-8"; + LC_MONETARY = "en_US.UTF-8"; + LC_PAPER = "en_US.UTF-8"; + LC_MEASUREMENT = "en_US.UTF-8"; + + buildInputs = [ git_archive_pkgs system_packages ]; + + } diff --git a/scripts/bm-report/report.Rmd b/scripts/bm-report/report.Rmd index d624d5a24c8ed..653d5f585f293 100644 --- a/scripts/bm-report/report.Rmd +++ b/scripts/bm-report/report.Rmd @@ -151,7 +151,7 @@ link_times |> ```{r big-objects} size_formatter <- function() { function(x) { - gdata::humanReadable(x, standard = "Unix") + prettyunits::pretty_bytes(x) } }