@jaspermayone.com's dotfiles
1{
2 pkgs,
3 lib,
4 stdenv,
5 fetchurl,
6 autoPatchelfHook,
7}:
8
9stdenv.mkDerivation rec {
10 pname = "zmx";
11 version = "0.1.0";
12
13 src = fetchurl {
14 url =
15 if stdenv.isLinux then
16 (
17 if stdenv.isAarch64 then
18 "https://zmx.sh/a/zmx-${version}-linux-aarch64.tar.gz"
19 else
20 "https://zmx.sh/a/zmx-${version}-linux-x86_64.tar.gz"
21 )
22 else if stdenv.isDarwin then
23 (
24 if stdenv.isAarch64 then
25 "https://zmx.sh/a/zmx-${version}-macos-aarch64.tar.gz"
26 else
27 "https://zmx.sh/a/zmx-${version}-macos-x86_64.tar.gz"
28 )
29 else
30 throw "Unsupported platform";
31
32 hash =
33 if stdenv.isLinux && stdenv.isAarch64 then
34 "sha256-cMGo+Af0VRY3c2EoNzVZFU53Kz5wKL8zsSSXIOtZVU8="
35 else if stdenv.isLinux then
36 "sha256-Zmqs/Y3be2z9KMuSwyTLZWKbIInzHgoC9Bm0S2jv3XI="
37 else if stdenv.isDarwin && stdenv.isAarch64 then
38 "sha256-34k5Q1cIr3+foubtMJVoHVHZtCLoSjwJK00e1p0JdLg="
39 else
40 "sha256-0epjoQhUSBYlE0L7Ubwn/sJF61+4BbxeaRx6EY/SklE=";
41 };
42
43 nativeBuildInputs = lib.optionals stdenv.isLinux [ autoPatchelfHook ];
44
45 sourceRoot = ".";
46
47 installPhase = ''
48 runHook preInstall
49 mkdir -p $out/bin
50 cp zmx $out/bin/
51 chmod +x $out/bin/zmx
52 runHook postInstall
53 '';
54
55 meta = with lib; {
56 description = "Session persistence for terminal processes";
57 homepage = "https://zmx.sh";
58 license = licenses.mit;
59 platforms = platforms.unix;
60 };
61}