about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/misc/pridefetch/default.nix
blob: 80fd1b0e9bc2de2ae0d3313a5e21ab48978437d5 (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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{ lib, stdenv, fetchFromGitHub, python3, zip }: let
  version = "1.1.0";
  sha256 = "sha256-563xOz63vto19yuaHtReV1dSw6BgNf+CLtS3lrPnaoc=";

  pname = "pridefetch";
  src = fetchFromGitHub {
    owner = "SpyHoodle";
    repo = pname;
    rev = "v" + version;
    inherit sha256;
  };
in stdenv.mkDerivation {
  inherit pname version src;
  nativeBuildInputs = [
    zip
  ];
  buildInputs = [
    (python3.withPackages (pythonPackages: with pythonPackages; [
      distro
    ]))
  ];
  buildPhase = ''
    runHook preBuild
    pushd src
    zip -r ../pridefetch.zip ./*
    popd
    echo '#!/usr/bin/env python' | cat - pridefetch.zip > pridefetch
    rm pridefetch.zip
    runHook postBuild
  '';
  installPhase = ''
    runHook preInstall
    mkdir -p $out/bin
    mv pridefetch $out/bin/pridefetch
    chmod +x $out/bin/pridefetch
    runHook postInstall
  '';
  meta = with lib; {
    description = "Print out system statistics with pride flags";
    longDescription = ''
      Pridefetch prints your system statistics (similarly to neofetch, screenfetch or pfetch) along with a pride flag.
      The flag which is printed is configurable, as well as the width of the output.
    '';
    homepage = "https://github.com/SpyHoodle/pridefetch";
    license = licenses.mit;
    maintainers = [
      maintainers.minion3665
    ];
    platforms = platforms.all;
  };
}