lol
1{
2 stdenv,
3 lib,
4 fetchFromGitHub,
5}:
6
7stdenv.mkDerivation rec {
8 pname = "starfetch";
9 version = "0.0.4";
10
11 src = fetchFromGitHub {
12 owner = "Haruno19";
13 repo = "starfetch";
14 rev = version;
15 sha256 = "sha256-I2M/FlLRkGtD2+GcK1l5+vFsb5tCb4T3UJTPxRx68Ww=";
16 };
17
18 postPatch = ''
19 substituteInPlace src/starfetch.cpp --replace-fail /usr/local/ $out/
20 ''
21 + lib.optionalString stdenv.cc.isClang ''
22 substituteInPlace makefile --replace-warn g++ clang++
23 '';
24
25 installPhase = ''
26 runHook preInstall
27
28 mkdir -p $out/bin
29 mkdir -p $out/share/starfetch
30 cp starfetch $out/bin/
31 cp -r res/* $out/share/starfetch/
32
33 runHook postInstall
34 '';
35
36 meta = with lib; {
37 description = "CLI star constellations displayer";
38 homepage = "https://github.com/Haruno19/starfetch";
39 license = licenses.gpl3Plus;
40 platforms = platforms.all;
41 maintainers = with maintainers; [ annaaurora ];
42 mainProgram = "starfetch";
43 };
44}