1{
2 fetchFromGitHub,
3 git,
4 lib,
5 python3,
6 rpm,
7 stdenv,
8}:
9
10let
11 # Most of the binaries are not really useful because they have hardcoded
12 # paths that only make sense when you're running the stock BlueField OS on
13 # your BlueField. These might be patched in the future with resholve
14 # (https://github.com/abathur/resholve). If there is one that makes sense
15 # without resholving it, it can simply be uncommented and will be included in
16 # the output.
17 binaries = [
18 # "bfacpievt"
19 # "bfbootmgr"
20 # "bfcfg"
21 # "bfcpu-freq"
22 # "bfdracut"
23 # "bffamily"
24 # "bfgrubcheck"
25 # "bfhcafw"
26 # "bfinst"
27 # "bfpxe"
28 # "bfrec"
29 "bfrshlog"
30 # "bfsbdump"
31 # "bfsbkeys"
32 # "bfsbverify"
33 # "bfver"
34 # "bfvcheck"
35 "mlx-mkbfb"
36 "bfup"
37 ];
38in
39stdenv.mkDerivation {
40 pname = "bfscripts";
41 version = "unstable-2025-06-27";
42
43 src = fetchFromGitHub {
44 owner = "Mellanox";
45 repo = "bfscripts";
46 rev = "ed8ede79fa002a2d83719a1bef6fbe0f7dcf37a4";
47 hash = "sha256-x+hpH6D5HTl39zD0vYj6wRFw881M4AcfM+ePcgXMst8=";
48 };
49
50 buildInputs = [
51 python3
52 ];
53
54 nativeBuildInputs = [
55 git
56 rpm
57 ];
58
59 installPhase = ''
60 ${lib.concatStringsSep "\n" (map (b: "install -D ${b} $out/bin/${b}") binaries)}
61 '';
62
63 meta = with lib; {
64 description = "Collection of scripts used for BlueField SoC system management";
65 homepage = "https://github.com/Mellanox/bfscripts";
66 license = licenses.bsd2;
67 platforms = platforms.linux;
68 maintainers = with maintainers; [
69 nikstur
70 thillux
71 ];
72 };
73}