about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/misc/monitorcontrol/default.nix
blob: 6c3a1ccec34e7c916a87807037732ca2481f0fd8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
{ lib, fetchurl, stdenv, _7zz }:

# This cannot be built from source due to the problematic nature of XCode - so
# this is what it's like when doves cry?

stdenv.mkDerivation rec {
  pname = "MonitorControl";
  version = "4.2.0";

  src = fetchurl {
    url =
      "https://github.com/MonitorControl/${pname}/releases/download/v${version}/MonitorControl.${version}.dmg";
    sha256 = "Q96uK6wVe1D2uLvWL+pFR6LcmrU7cgmr2Y5tPvvTDgI=";
  };

  # MonitorControl.${version}.dmg is APFS formatted, unpack with 7zz
  unpackCmd = ''
    runHook preUnpack

    7zz x $src

    runHook postUnpack
  '';

  nativeBuildInputs = [ _7zz ];

  sourceRoot = "MonitorControl.app";

  installPhase = ''
    mkdir -p "$out/Applications/MonitorControl.app"
    cp -R . "$out/Applications/MonitorControl.app"
  '';

  meta = with lib; {
    description = "A macOS system extension to control brightness and volume of external displays with native OSD";
    longDescription = "Controls your external display brightness and volume and shows native OSD. Use menulet sliders or the keyboard, including native Apple keys!";
    homepage = "https://github.com/MonitorControl/MonitorControl#readme";
    license = licenses.mit;
    maintainers = with maintainers; [ cbleslie cottand ];
    platforms = platforms.darwin;
  };
}