1{
2 lib,
3 config,
4 newScope,
5 dbus,
6 versionCheckHook,
7 nushell,
8 runCommand,
9}:
10
11lib.makeScope newScope (
12 self:
13
14 lib.mapAttrs
15 (
16 _n: p:
17 let
18 # add two checks:
19 # - `versionCheckhook`, checks wether it's a binary that is able to
20 # display its own version
21 # - A check which loads the plugin into the current version of nushell,
22 # to detect incompatibilities (plugins are compiled for very specific
23 # versions of nushell). If this fails, either update the plugin or mark
24 # as broken.
25 withChecks = p.overrideAttrs (
26 final: _prev: {
27 doInstallCheck = true;
28 nativeInstallCheckInputs = [ versionCheckHook ];
29
30 passthru.tests.loadCheck =
31 let
32 nu = lib.getExe nushell;
33 plugin = lib.getExe withChecks;
34 in
35 runCommand "test-load-${final.pname}" { } ''
36 touch $out
37 ${nu} -n -c "plugin add --plugin-config $out ${plugin}"
38 ${nu} -n -c "plugin use --plugin-config $out ${plugin}"
39 '';
40 }
41 );
42 in
43 withChecks
44 )
45 (
46 with self;
47 {
48 gstat = callPackage ./gstat.nix { };
49 formats = callPackage ./formats.nix { };
50 polars = callPackage ./polars.nix { };
51 query = callPackage ./query.nix { };
52 net = callPackage ./net.nix { };
53 units = callPackage ./units.nix { };
54 highlight = callPackage ./highlight.nix { };
55 dbus = callPackage ./dbus.nix {
56 inherit dbus;
57 };
58 skim = callPackage ./skim.nix { };
59 semver = callPackage ./semver.nix { };
60 hcl = callPackage ./hcl.nix { };
61 desktop_notifications = callPackage ./desktop_notifications.nix { };
62 }
63 // lib.optionalAttrs config.allowAliases {
64 regex = throw "`nu_plugin_regex` is no longer compatible with the current Nushell release.";
65 }
66 )
67)