depot/third_party/nixpkgs/pkgs/by-name/m1/m1ddc/package.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

43 lines
948 B
Nix

{ stdenv
, darwin
, fetchFromGitHub
, lib
}:
stdenv.mkDerivation (finalAttrs: {
pname = "m1ddc";
version = "1.2.0";
src = fetchFromGitHub {
owner = "waydabber";
repo = "m1ddc";
rev = "v${finalAttrs.version}";
hash = "sha256-obs2qQvSkIDsWhCXJOF1Geiqqy19KDf0InyxRVod4hk=";
};
postPatch = ''
substituteInPlace sources/ioregistry.m \
--replace-fail kIOMainPortDefault kIOMasterPortDefault
'';
buildInputs = with darwin.apple_sdk_11_0.frameworks; [
CoreDisplay
Foundation
];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp m1ddc $out/bin
runHook postInstall
'';
meta = {
description = "Control external displays using DDC/CI on Apple Silicon Macs";
homepage = "https://github.com/waydabber/m1ddc";
license = lib.licenses.mit;
mainProgram = "m1ddc";
maintainers = [ lib.maintainers.joanmassachs ];
platforms = [ "aarch64-darwin" ];
};
})