{ lib, stdenvNoCC, fetchurl, undmg, xar, cpio, fonts ? true, full ? false, app ? false, }: stdenvNoCC.mkDerivation rec { pname = "sf-symbols"; version = "6"; src = fetchurl { url = "https://devimages-cdn.apple.com/design/resources/download/SF-Symbols-${version}.dmg"; sha256 = "sha256-hG6QyidNVtI0pXO698oGVsG4awy8XWr27nEyYSUMhPo="; }; nativeBuildInputs = [ cpio xar undmg ]; unpackPhase = '' undmg $src xar -xf SF\ Symbols.pkg cd SFSymbols.pkg zcat Payload | cpio -id ''; sourceRoot = "."; installPhase = '' '' + lib.optionalString fonts '' mkdir -p $out/share/fonts/truetype cp ./Library/Fonts/${ if full then "*" else "SF-Pro.ttf" } $out/share/fonts/truetype '' + lib.optionalString app '' mkdir -p $out/Applications cp -R ./Applications/SF\ Symbols.app $out/Applications ''; meta = { description = if app then "Tool that provides consistent, highly configurable symbols for apps" else "Fonts from SF Symbols"; homepage = "https://developer.apple.com/sf-symbols/"; platforms = if app then lib.platforms.darwin else lib.platforms.all; }; }