Skip to main content

STIG Viewer 3 NixOS

·1 min

I needed to view some STIGs on my machine and STIG Viewer didn’t exist on nixpkgs, so I made this derivation.

Copy the following and run nix-build stix-viewer.nix && ./result/bin/stig-viewer-3 to start the viewer.

{
  pkgs ? import <nixpkgs> { },
}:
with pkgs;
stdenv.mkDerivation rec {
  pname = "STIG Viewer 3";
  version = "3.5.1";

  src = fetchzip {
    url = "https://dl.dod.cyber.mil/wp-content/uploads/stigs/zip/U_STIGViewer-linux_x64-3-5-1.zip";
    sha256 = "sha256-J7FOt3PxajXAfjkmm/YOC1fINM2+jAMXQdEZz/TFLjc=";
  };

  buildInputs = [
    alsa-lib
    at-spi2-core
    cairo
    cups
    dbus
    expat
    glib
    gtk3
    libgbm
    libxkbcommon
    nspr
    nss
    pango
    xorg.libX11
    xorg.libxcb
    xorg.libXcomposite
    xorg.libXdamage
    xorg.libXext
    xorg.libXfixes
    xorg.libXrandr
  ];

  nativeBuildInputs = [
    unzip
    makeWrapper
  ];

  installPhase = ''
    mkdir -p $out/{bin,lib}

    cp -r * $out/
    ln -sf "$out/STIG Viewer 3" $out/bin/stig-viewer-3
    mv $out/*.so* $out/lib/

    wrapProgram $out/bin/stig-viewer-3 \
      --prefix LD_LIBRARY_PATH : "$out/lib" \
      --suffix LD_LIBRARY_PATH : "${lib.makeLibraryPath buildInputs}"
  '';
}
Neal Fennimore
Author
Neal Fennimore
Software and IT Security Engineering expert with over 14 years of comprehensive experience in systems development, data analysis, cloud and network security.