1 { config, lib, pkgs, ... }:
3 hpssacli = pkgs.stdenv.mkDerivation rec {
9 "https://downloads.linux.hpe.com/SDR/downloads/MCP/Ubuntu/pool/non-free/${pname}-${version}_amd64.deb"
10 "http://apt.netangels.net/pool/main/h/hpssacli/${pname}-${version}_amd64.deb"
12 sha256 = "11w7fwk93lmfw0yya4jpjwdmgjimqxx6412sqa166g1pz4jil4sw";
15 nativeBuildInputs = [ pkgs.dpkg ];
17 unpackPhase = "dpkg -x $src ./";
20 mkdir -p $out/bin $out/share/doc $out/share/man
21 mv opt/hp/hpssacli/bld/{hpssascripting,hprmstr,hpssacli} $out/bin/
22 mv opt/hp/hpssacli/bld/*.{license,txt} $out/share/doc/
23 mv usr/man $out/share/
25 for file in $out/bin/*; do
27 patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
28 --set-rpath ${lib.makeLibraryPath [ pkgs.stdenv.cc.cc ]} \
36 description = "HP Smart Array CLI";
37 homepage = "https://downloads.linux.hpe.com/SDR/downloads/MCP/Ubuntu/pool/non-free/";
38 license = licenses.unfreeRedistributable;
39 platforms = [ "x86_64-linux" ];
47 hardware.raid.HPSmartArray = {
48 enable = lib.mkEnableOption "HP Smart Array kernel modules and CLI utility";
54 config = lib.mkIf config.hardware.raid.HPSmartArray.enable {
56 boot.initrd.kernelModules = [ "sg" ]; /* hpssacli wants it */
57 boot.initrd.availableKernelModules = [ "hpsa" ];
59 environment.systemPackages = [ hpssacli ];