···11+{ lib, fetchurl, stdenv, undmg }:
22+33+# This cannot be built from source due to the problematic nature of XCode - so
44+# this is what it's like when doves cry?
55+66+stdenv.mkDerivation rec {
77+ pname = "MonitorControl";
88+ version = "4.1.0";
99+1010+ src = fetchurl {
1111+ url =
1212+ "https://github.com/MonitorControl/${pname}/releases/download/v${version}/MonitorControl.${version}.dmg";
1313+ sha256 = "iaxM9j78Sq1EH5TCY240N+D5bG6quk2dZj8T7nt9ATo=";
1414+ };
1515+1616+ nativeBuildInputs = [ undmg ];
1717+1818+ sourceRoot = "MonitorControl.app";
1919+2020+ installPhase = ''
2121+ mkdir -p "$out/Applications/MonitorControl.app"
2222+ cp -R . "$out/Applications/MonitorControl.app"
2323+ '';
2424+2525+ meta = with lib; {
2626+ description = "A macOS system extension to control brightness and volume of external displays with native OSD";
2727+ longDescription = "Controls your external display brightness and volume and shows native OSD. Use menulet sliders or the keyboard, including native Apple keys!";
2828+ homepage = "https://github.com/MonitorControl/MonitorControl#readme";
2929+ license = licenses.mit;
3030+ maintainers = with maintainers; [ cbleslie ];
3131+ platforms = platforms.darwin;
3232+ };
3333+}