about summary refs log tree commit diff
path: root/pkgs/os-specific/darwin/openwith/default.nix
blob: eb78f7a1344c4ac3c459692fd29934ce93d4bd34 (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
{ lib, stdenv, fetchFromGitHub, swift, AppKit, Foundation, UniformTypeIdentifiers }:

let
  arch = if stdenv.isAarch64 then "arm64" else "x86_64";
in
stdenv.mkDerivation rec {
  pname = "openwith";
  version = "unstable-2022-10-28";

  src = fetchFromGitHub {
    owner = "jdek";
    repo = "openwith";
    rev = "a8a99ba0d1cabee7cb470994a1e2507385c30b6e";
    hash = "sha256-lysleg3qM2MndXeKjNk+Y9Tkk40urXA2ZdxY5KZNANo=";
  };

  nativeBuildInputs = [ swift ];

  buildInputs = [ AppKit Foundation UniformTypeIdentifiers ];

  makeFlags = [ "openwith_${arch}" ];

  installPhase = ''
    runHook preInstall
    install openwith_${arch} -D $out/bin/openwith
    runHook postInstall
  '';

  meta = with lib; {
    description = "Utility to specify which application bundle should open specific file extensions";
    homepage = "https://github.com/jdek/openwith";
    license = licenses.unlicense;
    maintainers = with maintainers; [ zowoq ];
    platforms = [ "aarch64-darwin" "x86_64-darwin" ];
    broken = stdenv.isx86_64; # https://hydra.nixos.org/build/219354133/nixlog/3
  };
}