nushellPlugins.*: add versionCheckHook

Why for each all at the same time? Because all nushell plugins should
respond in the same way with either no arguments passed or with
`--help`, which contains their version.

Also because when new plugins get added or plugins get updated, problems
can be easily spotted because the errors are really loud.
This commit is contained in:
Tom van Dijk
2025-06-28 01:31:24 +02:00
parent bd065b6888
commit 8541ae6c6a

View File

@@ -3,28 +3,40 @@
config,
newScope,
dbus,
versionCheckHook,
}:
lib.makeScope newScope (
self:
with self;
{
gstat = callPackage ./gstat.nix { };
formats = callPackage ./formats.nix { };
polars = callPackage ./polars.nix { };
query = callPackage ./query.nix { };
net = callPackage ./net.nix { };
units = callPackage ./units.nix { };
highlight = callPackage ./highlight.nix { };
dbus = callPackage ./dbus.nix {
inherit dbus;
nushell_plugin_dbus = self.dbus;
};
skim = callPackage ./skim.nix { };
semver = callPackage ./semver.nix { };
hcl = callPackage ./hcl.nix { };
}
// lib.optionalAttrs config.allowAliases {
regex = throw "`nu_plugin_regex` is no longer compatible with the current Nushell release.";
}
lib.mapAttrs
(
_n: p:
p.overrideAttrs {
doInstallCheck = true;
nativeInstallCheckInputs = [ versionCheckHook ];
}
)
(
with self;
{
gstat = callPackage ./gstat.nix { };
formats = callPackage ./formats.nix { };
polars = callPackage ./polars.nix { };
query = callPackage ./query.nix { };
net = callPackage ./net.nix { };
units = callPackage ./units.nix { };
highlight = callPackage ./highlight.nix { };
dbus = callPackage ./dbus.nix {
inherit dbus;
nushell_plugin_dbus = self.dbus;
};
skim = callPackage ./skim.nix { };
semver = callPackage ./semver.nix { };
hcl = callPackage ./hcl.nix { };
}
// lib.optionalAttrs config.allowAliases {
regex = throw "`nu_plugin_regex` is no longer compatible with the current Nushell release.";
}
)
)