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;