8 hpssacli = pkgs.stdenv.mkDerivation rec {
10 version = "2.40-13.0";
14 "https://downloads.linux.hpe.com/SDR/downloads/MCP/Ubuntu/pool/non-free/${pname}-${version}_amd64.deb"
15 "http://apt.netangels.net/pool/main/h/hpssacli/${pname}-${version}_amd64.deb"
17 sha256 = "11w7fwk93lmfw0yya4jpjwdmgjimqxx6412sqa166g1pz4jil4sw";
20 nativeBuildInputs = [ pkgs.dpkg ];
22 unpackPhase = "dpkg -x $src ./";
25 mkdir -p $out/bin $out/share/doc $out/share/man
26 mv opt/hp/hpssacli/bld/{hpssascripting,hprmstr,hpssacli} $out/bin/
27 mv opt/hp/hpssacli/bld/*.{license,txt} $out/share/doc/
28 mv usr/man $out/share/
30 for file in $out/bin/*; do
32 patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
33 --set-rpath ${lib.makeLibraryPath [ pkgs.stdenv.cc.cc ]} \
41 description = "HP Smart Array CLI";
42 homepage = "https://downloads.linux.hpe.com/SDR/downloads/MCP/Ubuntu/pool/non-free/";
43 license = licenses.unfreeRedistributable;
44 platforms = [ "x86_64-linux" ];
53 hardware.raid.HPSmartArray = {
54 enable = lib.mkEnableOption "HP Smart Array kernel modules and CLI utility";
60 config = lib.mkIf config.hardware.raid.HPSmartArray.enable {
62 boot.initrd.kernelModules = [ "sg" ]; # hpssacli wants it
63 boot.initrd.availableKernelModules = [ "hpsa" ];
65 environment.systemPackages = [ hpssacli ];