From 579e66c5f1dfa91f310b8de3f3d2715df8f85cec Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Sat, 26 Apr 2025 23:36:30 +0900 Subject: [PATCH] dprint-plugins: add installCheckPhase Co-authored-by: Phani Rithvij --- pkgs/by-name/dp/dprint/plugins/default.nix | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/pkgs/by-name/dp/dprint/plugins/default.nix b/pkgs/by-name/dp/dprint/plugins/default.nix index 391a23e3e4cb..94dc9db6819c 100644 --- a/pkgs/by-name/dp/dprint/plugins/default.nix +++ b/pkgs/by-name/dp/dprint/plugins/default.nix @@ -2,6 +2,8 @@ lib, fetchurl, stdenv, + dprint, + writableTmpDirAsHomeHook, }: let mkDprintPlugin = @@ -34,6 +36,21 @@ let mkdir -p $out cp $src $out/plugin.wasm ''; + doInstallCheck = true; + nativeInstallCheckInputs = [ + dprint + writableTmpDirAsHomeHook + ]; + # Prevent schema unmatching errors + # See https://github.com/NixOS/nixpkgs/pull/369415#issuecomment-2566112144 for detail + installCheckPhase = '' + runHook preInstallCheck + + mkdir empty && cd empty + dprint check --allow-no-files --plugins "$out/plugin.wasm" + + runHook postInstallCheck + ''; passthru = { updateScript = ./update-plugins.py; inherit initConfig updateUrl;