nushellPlugins.dbus: refactor

(cherry picked from commit a76d03be7d)
This commit is contained in:
Tom van Dijk
2025-06-28 00:23:41 +02:00
parent f17003d185
commit 05eb737f2c

View File

@@ -11,18 +11,17 @@
nushell_plugin_dbus,
}:
rustPlatform.buildRustPackage rec {
rustPlatform.buildRustPackage (finalAttrs: {
pname = "nu_plugin_dbus";
version = "0.14.0";
src = fetchFromGitHub {
owner = "devyn";
repo = pname;
rev = version;
repo = "nu_plugin_dbus";
tag = finalAttrs.version;
hash = "sha256-Ga+1zFwS/v+3iKVEz7TFmJjyBW/gq6leHeyH2vjawto=";
};
useFetchCargoVendor = true;
cargoHash = "sha256-7pD5LA1ytO7VqFnHwgf7vW9eS3olnZBgdsj+rmcHkbU=";
nativeBuildInputs = [ pkg-config ] ++ lib.optionals stdenv.cc.isClang [ rustPlatform.bindgenHook ];
@@ -35,19 +34,19 @@ rustPlatform.buildRustPackage rec {
nu = lib.getExe nushell;
plugin = lib.getExe nushell_plugin_dbus;
in
runCommand "${pname}-test" { } ''
runCommand "${finalAttrs.pname}-test" { } ''
touch $out
${nu} -n -c "plugin add --plugin-config $out ${plugin}"
${nu} -n -c "plugin use --plugin-config $out dbus"
'';
};
meta = with lib; {
meta = {
description = "Nushell plugin for communicating with D-Bus";
mainProgram = "nu_plugin_dbus";
homepage = "https://github.com/devyn/nu_plugin_dbus";
license = licenses.mit;
maintainers = with maintainers; [ aftix ];
platforms = with platforms; linux;
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ aftix ];
platforms = lib.platforms.linux;
};
}
})