dotfiles/nix/nushell-plugins.nix

76 lines
2.2 KiB
Nix
Raw Normal View History

2024-05-20 21:14:35 +02:00
{ config, lib, pkgs, ... }:
2024-07-16 13:27:43 +02:00
let
nu-ver = "0.95.0";
in
2024-05-20 21:14:35 +02:00
{
options.nushell-plugins = lib.mkOption { };
config.nushell-plugins = [
2024-07-16 13:27:43 +02:00
(pkgs.rustPlatform.buildRustPackage rec {
2024-05-20 21:14:35 +02:00
name = "nu-plugin-dbus";
2024-07-16 13:27:43 +02:00
version = "0.8.0";
2024-05-20 21:14:35 +02:00
src = pkgs.fetchCrate {
2024-07-16 13:27:43 +02:00
inherit version;
2024-05-20 21:14:35 +02:00
pname = "nu_plugin_dbus";
2024-07-09 00:47:38 +02:00
hash = "sha256-Ogc4iw0LIDoxyQnoTXzbNaQ6jHtkjmWja/a3TB1TZjk=";
2024-05-20 21:14:35 +02:00
};
2024-07-09 00:47:38 +02:00
cargoSha256 = "sha256-Q7ASOcS/d2YM02kaIwRzIegGcESU3mr/qRpxwv4KGHo=";
2024-05-20 21:14:35 +02:00
nativeBuildInputs = with pkgs; [ pkg-config ];
buildInputs = with pkgs; [ dbus ];
})
2024-07-16 13:27:43 +02:00
(pkgs.rustPlatform.buildRustPackage rec {
2024-05-20 21:14:35 +02:00
name = "nu-plugin-formats";
2024-07-16 13:27:43 +02:00
version = nu-ver;
2024-05-20 21:14:35 +02:00
src = pkgs.fetchCrate {
2024-07-16 13:27:43 +02:00
inherit version;
2024-05-20 21:14:35 +02:00
pname = "nu_plugin_formats";
2024-07-09 00:47:38 +02:00
hash = "sha256-nwfLQxVzzUfBn7m1F669NThqzG9bAXlM/lCAVGDKY8o=";
2024-05-20 21:14:35 +02:00
};
2024-07-09 00:47:38 +02:00
cargoSha256 = "sha256-e8VcSJYH5P4LR1bFbmeiiF+fSfRlqTEzfnkPtUFmB2I=";
2024-05-20 21:14:35 +02:00
})
2024-07-16 13:27:43 +02:00
(pkgs.rustPlatform.buildRustPackage rec {
2024-05-20 21:14:35 +02:00
name = "nu-plugin-polars";
2024-07-16 13:27:43 +02:00
version = nu-ver;
2024-05-20 21:14:35 +02:00
src = pkgs.fetchCrate {
2024-07-16 13:27:43 +02:00
inherit version;
2024-05-20 21:14:35 +02:00
pname = "nu_plugin_polars";
2024-07-09 00:47:38 +02:00
hash = "sha256-d2giFOByeX/lLc6k3e4cf/RodwV2yLjqeZD+cmVIwK8=";
2024-05-20 21:14:35 +02:00
};
2024-07-09 00:47:38 +02:00
cargoSha256 = "sha256-e0r693pJJM3IjKjjwxvoIUi3y6avUI9m2qQ9rpSAtLU=";
2024-05-20 21:14:35 +02:00
doCheck = false; # Needs OpenSSL, which build doesn't for some reason.
})
2024-07-16 13:27:43 +02:00
(pkgs.rustPlatform.buildRustPackage rec {
name = "nu-plugin-query";
version = nu-ver;
src = pkgs.fetchCrate {
inherit version;
pname = "nu_plugin_query";
hash = "sha256-3lWBqP3ZeHsQApvZmvAsVgseZWrIPDfgm+lZxkDO1JE=";
};
cargoSha256 = "sha256-BOAzv7N9UfIxIA0YGYLc/DfU5VSowYtxe6UYZjQ/rf4=";
})
2024-05-20 21:14:35 +02:00
];
2024-06-17 21:17:17 +02:00
config.output.packages.nushell-plugins =
let
pluginName = d: lib.removePrefix "nu-plugin-" d.name;
in
pkgs.writeTextFile {
name = "add-plugins.nu";
text = builtins.concatStringsSep "\n"
2024-05-27 11:59:20 +02:00
(map
(d:
''
if (plugin list | any { |p| $p.name == "${pluginName d}" }) { plugin rm ${pluginName d} }
plugin add ${lib.getBin d}/bin/${builtins.replaceStrings ["-"] ["_"] d.name}
'')
2024-05-27 11:59:20 +02:00
config.nushell-plugins);
};
2024-05-20 21:14:35 +02:00
}