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