about summary refs log tree commit diff
path: root/nixpkgs/pkgs/os-specific/darwin/raycast/default.nix
blob: 796d3912f977707796c52784e87c857915055b54 (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
43
44
45
46
47
48
49
{ lib
, stdenvNoCC
, fetchurl
, undmg
}:

stdenvNoCC.mkDerivation rec {
  pname = "raycast";
  version = "1.53.0";

  src = fetchurl {
    # https://github.com/NixOS/nixpkgs/pull/223495
    # official download API: https://api.raycast.app/v2/download
    # this returns an AWS CloudFront signed URL with expiration timestamp and signature
    # the returned URL will always be the latest Raycast which might result in an impure derivation
    # the package maintainer created a repo (https://github.com/stepbrobd/raycast-overlay)
    # to host GitHub Actions to periodically check for updates
    # and re-release the `.dmg` file to Internet Archive (https://archive.org/details/raycast)
    url = "https://archive.org/download/raycast/raycast-${version}.dmg";
    sha256 = "sha256-IkLbfuzkgO/E8U8PjZ6NQ28WEVeBumKYbbKpK/LPwNY=";
  };

  dontPatch = true;
  dontConfigure = true;
  dontBuild = true;
  dontFixup = true;

  nativeBuildInputs = [ undmg ];

  sourceRoot = "Raycast.app";

  installPhase = ''
    runHook preInstall

    mkdir -p $out/Applications/Raycast.app
    cp -R . $out/Applications/Raycast.app

    runHook postInstall
  '';

  meta = with lib; {
    description = "Control your tools with a few keystrokes";
    homepage = "https://raycast.app/";
    license = licenses.unfree;
    sourceProvenance = with sourceTypes; [ binaryNativeCode ];
    maintainers = with maintainers; [ lovesegfault stepbrobd ];
    platforms = platforms.darwin;
  };
}