|
5 | 5 |
|
6 | 6 | let
|
7 | 7 |
|
8 |
| - nu-libraries = let # Shortcut to build a nu library without too much fuss: |
9 |
| - simpleNuLib = name: extraArgs: |
10 |
| - self.lib.makeNuLibrary ({ |
11 |
| - inherit pkgs name; |
12 |
| - src = inputs."${name}-src"; |
13 |
| - } // extraArgs); |
14 |
| - in { |
| 8 | + nu-libraries = |
| 9 | + let # Shortcut to build a nu library without too much fuss: |
| 10 | + simpleNuLib = name: extraArgs: |
| 11 | + self.lib.makeNuLibrary ({ |
| 12 | + inherit pkgs name; |
| 13 | + src = inputs."${name}-src"; |
| 14 | + } // extraArgs); |
| 15 | + in |
| 16 | + { |
| 17 | + nu-batteries = simpleNuLib "nu-batteries" { }; |
15 | 18 |
|
16 |
| - nu-batteries = simpleNuLib "nu-batteries" { }; |
17 |
| - webserver-nu = simpleNuLib "webserver-nu" { |
18 |
| - path = with pkgs; [ "${netcat}/bin" "${coreutils}/bin" ]; |
| 19 | + webserver-nu = simpleNuLib "webserver-nu" { |
| 20 | + path = with pkgs; [ "${netcat}/bin" "${coreutils}/bin" ]; |
| 21 | + }; |
19 | 22 | };
|
20 | 23 |
|
21 |
| - }; |
22 |
| - |
23 |
| - nu-plugins = let |
24 |
| - craneLib = inputs.crane.mkLib pkgs; |
| 24 | + nu-plugins = |
| 25 | + let |
| 26 | + craneLib = inputs.crane.mkLib pkgs; |
25 | 27 |
|
26 |
| - cratesIoJsonIndex = self.lib.runNuScript pkgs "plugins-in-crates.io-index" |
27 |
| - ../nu-src/list-plugins-in-index.nu [ inputs.crates-io-index ]; |
| 28 | + cratesIoJsonIndex = self.lib.runNuScript pkgs "plugins-in-crates.io-index" |
| 29 | + ../nu-src/list-plugins-in-index.nu [ inputs.crates-io-index ]; |
28 | 30 |
|
29 |
| - cratesIoIndex = |
30 |
| - builtins.fromJSON (builtins.readFile "${cratesIoJsonIndex}/plugins.json"); |
| 31 | + cratesIoIndex = |
| 32 | + builtins.fromJSON (builtins.readFile "${cratesIoJsonIndex}/plugins.json"); |
31 | 33 |
|
32 |
| - pluginsBaseBuildInputs = with pkgs; |
33 |
| - [ pkg-config ] ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ |
34 |
| - iconv |
35 |
| - darwin.apple_sdk.frameworks.IOKit |
36 |
| - darwin.apple_sdk.frameworks.Security |
37 |
| - ]; |
| 34 | + pluginsBaseBuildInputs = with pkgs; |
| 35 | + [ pkg-config ] ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ |
| 36 | + iconv |
| 37 | + darwin.apple_sdk.frameworks.IOKit |
| 38 | + darwin.apple_sdk.frameworks.Security |
| 39 | + ]; |
38 | 40 |
|
39 |
| - # Non-rust dependencies for plugins from crates.io |
40 |
| - # |
41 |
| - # Deps are to be added here on a case-by-case fashion |
42 |
| - buildInputsForPluginsFromCratesIo = with pkgs; { |
43 |
| - binaryview = [ xorg.libX11 ]; |
44 |
| - cloud = [ openssl ]; |
45 |
| - dbus = [ dbus ]; |
46 |
| - fetch = [ openssl ]; |
47 |
| - from_dhall = [ openssl ]; |
48 |
| - gstat = [ openssl ]; |
49 |
| - plotters = [ fontconfig ]; |
50 |
| - polars = [ openssl ]; |
51 |
| - post = [ openssl ]; |
52 |
| - prometheus = [ openssl ]; |
53 |
| - query = [ openssl ]; |
54 |
| - s3 = [ openssl ]; |
55 |
| - }; |
56 |
| - |
57 |
| - buildPluginFromCratesIo = { name, ... }@nameVerCksum: |
58 |
| - let |
59 |
| - src = craneLib.downloadCargoPackage (nameVerCksum // { |
60 |
| - source = "registry+https://github.com/rust-lang/crates.io-index"; |
61 |
| - }); |
62 |
| - shortName = builtins.replaceStrings ["nu_plugin_"] [""] name; |
63 |
| - buildInputs = pluginsBaseBuildInputs |
64 |
| - ++ (buildInputsForPluginsFromCratesIo.${shortName} or [ ]); |
65 |
| - cargoArtifacts = craneLib.buildDepsOnly { inherit src buildInputs; }; |
66 |
| - in craneLib.buildPackage { |
67 |
| - inherit src buildInputs cargoArtifacts; |
68 |
| - doCheck = false; |
| 41 | + # Non-rust dependencies for plugins from crates.io |
| 42 | + # |
| 43 | + # Deps are to be added here on a case-by-case fashion |
| 44 | + buildInputsForPluginsFromCratesIo = with pkgs; { |
| 45 | + binaryview = [ xorg.libX11 ]; |
| 46 | + cloud = [ openssl ]; |
| 47 | + dbus = [ dbus ]; |
| 48 | + fetch = [ openssl ]; |
| 49 | + from_dhall = [ openssl ]; |
| 50 | + gstat = [ openssl ]; |
| 51 | + plotters = [ fontconfig ]; |
| 52 | + polars = [ openssl ]; |
| 53 | + post = [ openssl ]; |
| 54 | + prometheus = [ openssl ]; |
| 55 | + query = [ openssl ]; |
| 56 | + s3 = [ openssl ]; |
69 | 57 | };
|
70 | 58 |
|
71 |
| - in ( # All the plugins from crates.io: |
72 |
| - # (Each attr is of the form "nu_plugin_<name>") |
73 |
| - builtins.mapAttrs (_: buildPluginFromCratesIo) cratesIoIndex) // { |
| 59 | + buildPluginFromCratesIo = { name, ... }@nameVerCksum: |
| 60 | + let |
| 61 | + src = craneLib.downloadCargoPackage (nameVerCksum // { |
| 62 | + source = "registry+https://github.com/rust-lang/crates.io-index"; |
| 63 | + }); |
| 64 | + shortName = builtins.replaceStrings [ "nu_plugin_" ] [ "" ] name; |
| 65 | + buildInputs = pluginsBaseBuildInputs |
| 66 | + ++ (buildInputsForPluginsFromCratesIo.${shortName} or [ ]); |
| 67 | + cargoArtifacts = craneLib.buildDepsOnly { inherit src buildInputs; }; |
| 68 | + in |
| 69 | + craneLib.buildPackage { |
| 70 | + inherit src buildInputs cargoArtifacts; |
| 71 | + doCheck = false; |
| 72 | + }; |
| 73 | + |
| 74 | + in |
| 75 | + (# All the plugins from crates.io: |
| 76 | + # (Each attr is of the form "nu_plugin_<name>") |
| 77 | + builtins.mapAttrs (_: buildPluginFromCratesIo) cratesIoIndex) // { |
74 | 78 | # Nu plugins from sources other than crates.io:
|
75 | 79 |
|
76 |
| - nu_plugin_httpserve = let |
77 |
| - src = craneLib.cleanCargoSource inputs.nu_plugin_httpserve-src; |
78 |
| - buildInputs = pluginsBaseBuildInputs; |
79 |
| - cargoArtifacts = craneLib.buildDepsOnly { inherit src buildInputs; }; |
80 |
| - in craneLib.buildPackage { inherit src buildInputs cargoArtifacts; }; |
| 80 | + nu_plugin_httpserve = |
| 81 | + let |
| 82 | + src = craneLib.cleanCargoSource inputs.nu_plugin_httpserve-src; |
| 83 | + buildInputs = pluginsBaseBuildInputs; |
| 84 | + cargoArtifacts = craneLib.buildDepsOnly { inherit src buildInputs; }; |
| 85 | + in |
| 86 | + craneLib.buildPackage { inherit src buildInputs cargoArtifacts; }; |
81 | 87 |
|
82 | 88 | };
|
83 | 89 |
|
84 |
| -in nu-libraries // nu-plugins |
| 90 | +in |
| 91 | +nu-libraries // nu-plugins |
0 commit comments