1{
2 lib,
3 fetchurl,
4 stdenv,
5 undmg,
6}:
7
8# This cannot be built from source due to the problematic nature of XCode - so
9# this is what it's like when doves cry?
10
11stdenv.mkDerivation rec {
12 pname = "MonitorControl";
13 version = "4.3.3";
14
15 src = fetchurl {
16 url = "https://github.com/MonitorControl/${pname}/releases/download/v${version}/MonitorControl.${version}.dmg";
17 hash = "sha256-myx3adoU3FYYrs6LFRSiXtwSsoaujjQ/PYgAF/Xuk2g=";
18 };
19
20 nativeBuildInputs = [ undmg ];
21
22 sourceRoot = "MonitorControl.app";
23
24 unpackCmd = ''
25 runHook preUnpack
26 undmg $src
27 runHook postUnpack
28 '';
29
30 installPhase = ''
31 mkdir -p "$out/Applications/MonitorControl.app"
32 cp -R . "$out/Applications/MonitorControl.app"
33 '';
34
35 meta = with lib; {
36 description = "MacOS system extension to control brightness and volume of external displays with native OSD";
37 longDescription = "Controls your external display brightness and volume and shows native OSD. Use menulet sliders or the keyboard, including native Apple keys!";
38 homepage = "https://github.com/MonitorControl/MonitorControl#readme";
39 license = licenses.mit;
40 maintainers = with maintainers; [
41 cbleslie
42 cottand
43 ];
44 platforms = platforms.darwin;
45 };
46}