about summary refs log tree commit diff
path: root/pkgs/tools/misc/starfetch/default.nix
blob: 3dfff1400e9e5c055e416463c2f3a53e4f485888 (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
{ stdenv, lib, fetchFromGitHub }:

stdenv.mkDerivation rec {
  pname = "starfetch";
  version = "0.0.2";

  src = fetchFromGitHub {
    owner = "Haruno19";
    repo = "starfetch";
    rev = version;
    sha256 = "sha256-waJ1DbOqhZ3hHtqcODSXBC+O46S8RSxuBuoEqs8OfgI=";
  };

  postPatch = ''
    substituteInPlace src/starfetch.cpp --replace /usr/local/ $out/
  '';

  installPhase = ''
    runHook preInstall

    mkdir -p $out/bin
    mkdir -p $out/share/starfetch
    cp starfetch $out/bin/
    cp -r res/* $out/share/starfetch/

    runHook postInstall
  '';

  meta = with lib; {
    description = "CLI star constellations displayer";
    homepage = "https://github.com/Haruno19/starfetch";
    license = licenses.gpl3Plus;
    platforms = platforms.all;
    maintainers = with maintainers; [ papojari ];
  };
}