From 802b618473650c3e21ed0e1c8ee7a468d82e13d8 Mon Sep 17 00:00:00 2001 From: Marie Ramlow Date: Fri, 15 Mar 2024 13:12:24 +0100 Subject: [PATCH] gauge: add fromManifest helper function --- pkgs/development/tools/gauge/wrapper.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkgs/development/tools/gauge/wrapper.nix b/pkgs/development/tools/gauge/wrapper.nix index 12e2923ada05..67b1a8ddc52b 100644 --- a/pkgs/development/tools/gauge/wrapper.nix +++ b/pkgs/development/tools/gauge/wrapper.nix @@ -45,7 +45,15 @@ stdenvNoCC.mkDerivation { nativeBuildInputs = [ gauge-unwrapped makeWrapper xorg.lndir ]; - passthru.withPlugins = f: gauge.override { plugins = f gaugePlugins; }; + passthru = { + withPlugins = f: gauge.override { plugins = f gaugePlugins; }; + fromManifest = path: + let + manifest = lib.importJSON path; + requiredPlugins = with manifest; [ Language ] ++ Plugins; + manifestPlugins = plugins: map (name: plugins.${name} or (throw "Gauge plugin ${name} is not available!")) requiredPlugins; + in gauge.withPlugins manifestPlugins; + }; inherit (gauge-unwrapped) meta; }