1{
2 lib,
3 stdenvNoCC,
4 fetchurl,
5 undmg,
6 nix-update-script,
7}:
8stdenvNoCC.mkDerivation (finalAttrs: {
9 pname = "mos";
10 version = "3.5.0";
11
12 src = fetchurl {
13 url = "https://github.com/Caldis/Mos/releases/download/${finalAttrs.version}/Mos.Versions.${finalAttrs.version}.dmg";
14 hash = "sha256-o2H4cfMudjoQHfKeV4ORiO9/szoomFP0IP6D6ecMAI4=";
15 };
16 sourceRoot = ".";
17
18 nativeBuildInputs = [
19 undmg
20 ];
21
22 installPhase = ''
23 runHook preInstall
24 mkdir -p $out/Applications
25 cp -r *.app $out/Applications
26 runHook postInstall
27 '';
28
29 passthru.updateScript = nix-update-script { };
30
31 meta = with lib; {
32 description = "Smooths scrolling and set mouse scroll directions independently on macOS";
33 homepage = "https://mos.caldis.me/";
34 changelog = "https://github.com/Caldis/Mos/releases/tag/${finalAttrs.version}";
35 license = licenses.cc-by-nc-40;
36 maintainers = with lib.maintainers; [ xiaoxiangmoe ];
37 sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
38 platforms = platforms.darwin;
39 };
40})