1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 scsh,
6 sox,
7 libnotify,
8}:
9
10stdenv.mkDerivation {
11 pname = "pell";
12 version = "0.0.4";
13
14 src = fetchFromGitHub {
15 owner = "ebzzry";
16 repo = "pell";
17 rev = "f251625ece6bb5517227970287119e7d2dfcea8b";
18 sha256 = "0k8m1lv2kyrs8fylxmbgxg3jn65g57frf2bndc82gkr5svwb554a";
19 };
20
21 installPhase = ''
22 mkdir -p $out/bin
23 mkdir -p $out/share
24 cp pell $out/bin
25 cp resources/online.mp3 $out/share
26 cp resources/offline.mp3 $out/share
27 chmod +x $out/bin/pell
28 '';
29
30 postFixup = ''
31 substituteInPlace $out/bin/pell --replace "/usr/bin/env scsh" "${scsh}/bin/scsh"
32 substituteInPlace $out/bin/pell --replace "(play " "(${sox}/bin/play "
33 substituteInPlace $out/bin/pell --replace "(notify-send " "(${libnotify}/bin/notify-send "
34 substituteInPlace $out/bin/pell --replace "/usr/share/pell/online.mp3" "$out/share/online.mp3"
35 substituteInPlace $out/bin/pell --replace "/usr/share/pell/offline.mp3" "$out/share/offline.mp3"
36 '';
37
38 meta = with lib; {
39 homepage = "https://github.com/ebzzry/pell";
40 description = "Simple host availability monitor";
41 license = licenses.mit;
42 maintainers = [ maintainers.ebzzry ];
43 platforms = platforms.unix;
44 mainProgram = "pell";
45 };
46
47 dontBuild = true;
48}