{ stdenv, fetchurl, undmg, unzip, version ? "0.12", ... }: stdenv.mkDerivation { inherit version; pname = "yubiswitch"; nativeBuildInputs = [ undmg unzip ]; src = fetchurl { url = "https://github.com/pallotron/yubiswitch/releases/download/v${version}/yubiswitch_${version}.dmg"; sha256 = "aR/3AXwAAhFYchfGCmqfNSs8uNnuLOCZ8B0JbXlKAf8="; }; sourceRoot = "."; installPhase = '' runHook preInstall mkdir -p $out/Applications cp -r yubiswitch.app $out/Applications/yubiswitch.app runHook postInstall ''; }