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