about summary refs log tree commit diff
path: root/pkgs/os-specific/darwin/mysides/default.nix
blob: cdbfee5046a2aa70fc81c0d46e44af0e7755cfd1 (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
{ lib, stdenv, fetchurl, libarchive, p7zip }:

stdenv.mkDerivation rec {
  pname = "mysides";
  version = "1.0.1";

  src = fetchurl {
    url = "https://github.com/mosen/mysides/releases/download/v${version}/mysides-${version}.pkg";
    sha256 = "sha256-dpRrj3xb9xQSXXXxragUDgNPBaniiMc6evRF12wqVRQ=";
  };

  dontBuild = true;
  nativeBuildInputs = [ libarchive p7zip ];

  unpackPhase = ''
    7z x $src
    bsdtar -xf Payload~
  '';

  installPhase = ''
    runHook preInstall

    mkdir -p $out/bin
    install -Dm755 usr/local/bin/mysides -t $out/bin

    runHook postInstall
  '';

  meta = with lib; {
    description = "Manage macOS Finder sidebar favorites";
    homepage = "https://github.com/mosen/mysides";
    license = licenses.mit;
    maintainers = with maintainers; [ tboerger ];
    platforms = platforms.darwin;
  };
}