ark: init at 0.1.252 (#534888)

This commit is contained in:
Matthieu Coudron
2026-06-24 15:40:46 +00:00
committed by GitHub
3 changed files with 89 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
{ ark }:
# Jupyter notebook:
# nix shell --impure --expr 'with import ./. {}; [ (jupyter.override { definitions.r = r-ark-kernel.definition; }) ]' -c jupyter-notebook
{
definition = {
displayName = "Ark R Kernel";
argv = [
"${ark}/bin/ark"
"--connection_file"
"{connection_file}"
"--session-mode"
"notebook"
];
language = "R";
# Ark logs at INFO to stderr by default, which includes Jupyter messages.
# The notebook forwards this to the cell output, so quiet it to warnings.
#
# The `ark::console::console_comm=error` directive additionally silences a
# per-cell "UI comm is absent during dispatch" warning: after every execute,
# ark unconditionally tries to push an environment-pane update over the
# Positron-only `positron.ui` comm, which a plain Jupyter frontend never
# opens.
env = {
RUST_LOG = "ark=warn,ark::console::console_comm=error";
};
logo32 = null;
logo64 = null;
};
}

View File

@@ -0,0 +1,55 @@
{
lib,
rustPlatform,
fetchFromGitHub,
cmake,
makeBinaryWrapper,
R,
}:
rustPlatform.buildRustPackage (finalAttrs: {
pname = "ark";
version = "0.1.252";
__structuredAttrs = true;
src = fetchFromGitHub {
owner = "posit-dev";
repo = "ark";
rev = finalAttrs.version;
hash = "sha256-AI8i15UMI+KSmweXkS/UYITZBOEDx/knjpK9SA2M+Ns=";
};
cargoHash = "sha256-z9l0dgmZO6f63I/2pms4VMXMxO/9SAZSq1OFubGHIpw=";
# The amalthea crate bundles libzmq via the zeromq-src crate, which builds it
# with CMake.
nativeBuildInputs = [
cmake
makeBinaryWrapper
];
# Only build the `ark` binary, not the whole workspace's test/dev crates.
cargoBuildFlags = [
"--package"
"ark"
];
# Tests require a running R installation and network access.
doCheck = false;
# Ark loads R dynamically at runtime, locating it via `R_HOME` or by running
# `R RHOME`. Put R on PATH so the kernel works out of the box.
postInstall = ''
wrapProgram $out/bin/ark \
--suffix PATH : ${lib.makeBinPath [ R ]}
'';
meta = {
description = "R kernel for Jupyter applications, powering Positron's R support";
homepage = "https://github.com/posit-dev/ark";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ thomasjm ];
mainProgram = "ark";
platforms = lib.platforms.unix;
};
})

View File

@@ -2327,6 +2327,7 @@ with pkgs;
definitions = {
clojure = clojupyter.definition;
octave = octave-kernel.definition;
r = r-ark-kernel.definition;
# wolfram = wolfram-for-jupyter-kernel.definition; # unfree
};
};
@@ -4557,6 +4558,8 @@ with pkgs;
octave-kernel = recurseIntoAttrs (callPackage ../applications/editors/jupyter-kernels/octave { });
r-ark-kernel = callPackage ../applications/editors/jupyter-kernels/r-ark { };
octavePackages = recurseIntoAttrs octave.pkgs;
# PHP interpreters, packages and extensions.