mirror of
https://github.com/CHN-beta/nixpkgs.git
synced 2026-01-11 18:32:23 +08:00
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:
@@ -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.";
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user