nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 stdenv,
3 runCommand,
4 lib,
5 rustPlatform,
6 pkg-config,
7 nix-update-script,
8 fetchFromGitHub,
9 dbus,
10 nushell,
11 nushell_plugin_dbus,
12}:
13
14rustPlatform.buildRustPackage rec {
15 pname = "nu_plugin_dbus";
16 version = "0.14.0";
17
18 src = fetchFromGitHub {
19 owner = "devyn";
20 repo = pname;
21 rev = version;
22 hash = "sha256-Ga+1zFwS/v+3iKVEz7TFmJjyBW/gq6leHeyH2vjawto=";
23 };
24
25 useFetchCargoVendor = true;
26 cargoHash = "sha256-7pD5LA1ytO7VqFnHwgf7vW9eS3olnZBgdsj+rmcHkbU=";
27
28 nativeBuildInputs = [ pkg-config ] ++ lib.optionals stdenv.cc.isClang [ rustPlatform.bindgenHook ];
29 buildInputs = [ dbus ];
30
31 passthru = {
32 updateScript = nix-update-script { };
33 tests.check =
34 let
35 nu = lib.getExe nushell;
36 plugin = lib.getExe nushell_plugin_dbus;
37 in
38 runCommand "${pname}-test" { } ''
39 touch $out
40 ${nu} -n -c "plugin add --plugin-config $out ${plugin}"
41 ${nu} -n -c "plugin use --plugin-config $out dbus"
42 '';
43 };
44
45 meta = with lib; {
46 description = "Nushell plugin for communicating with D-Bus";
47 mainProgram = "nu_plugin_dbus";
48 homepage = "https://github.com/devyn/nu_plugin_dbus";
49 license = licenses.mit;
50 maintainers = with maintainers; [ aftix ];
51 platforms = with platforms; linux;
52 };
53}