Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 stdenv,
3 lib,
4 fetchFromGitHub,
5 makeWrapper,
6 coreutils,
7 gawk,
8 procps,
9 gnused,
10 bc,
11 findutils,
12 xdpyinfo,
13 xprop,
14 gnugrep,
15 ncurses,
16 pciutils,
17 darwin,
18}:
19
20let
21 path = lib.makeBinPath (
22 [
23 coreutils
24 gawk
25 gnused
26 findutils
27 gnugrep
28 ncurses
29 bc
30 pciutils
31 ]
32 ++ lib.optionals stdenv.hostPlatform.isLinux [
33 procps
34 xdpyinfo
35 xprop
36 ]
37 ++ lib.optionals stdenv.hostPlatform.isDarwin (
38 with darwin;
39 [
40 adv_cmds
41 DarwinTools
42 system_cmds
43 "/usr" # some commands like defaults is not available to us
44 ]
45 )
46 );
47
48in
49stdenv.mkDerivation rec {
50 pname = "screenfetch";
51 version = "3.9.9";
52
53 src = fetchFromGitHub {
54 owner = "KittyKatt";
55 repo = "screenFetch";
56 rev = "v${version}";
57 sha256 = "sha256-UNZMCLXhH4wDV0/fGWsB+KAi6aJVuPs6zpWXIQAqnjo=";
58 };
59
60 nativeBuildInputs = [ makeWrapper ];
61
62 installPhase = ''
63 install -Dm 0755 screenfetch-dev $out/bin/screenfetch
64 install -Dm 0644 screenfetch.1 $out/share/man/man1/screenfetch.1
65 install -Dm 0644 -t $out/share/doc/screenfetch CHANGELOG COPYING README.mkdn TODO
66
67 # Fix all of the dependencies of screenfetch
68 patchShebangs $out/bin/screenfetch
69 wrapProgram "$out/bin/screenfetch" \
70 --prefix PATH : ${path}
71 '';
72
73 meta = with lib; {
74 description = "Fetches system/theme information in terminal for Linux desktop screenshots";
75 longDescription = ''
76 screenFetch is a "Bash Screenshot Information Tool". This handy Bash
77 script can be used to generate one of those nifty terminal theme
78 information + ASCII distribution logos you see in everyone's screenshots
79 nowadays. It will auto-detect your distribution and display an ASCII
80 version of that distribution's logo and some valuable information to the
81 right. There are options to specify no ascii art, colors, taking a
82 screenshot upon displaying info, and even customizing the screenshot
83 command! This script is very easy to add to and can easily be extended.
84 '';
85 license = licenses.gpl3;
86 homepage = "https://github.com/KittyKatt/screenFetch";
87 maintainers = with maintainers; [ relrod ];
88 platforms = platforms.all;
89 mainProgram = "screenfetch";
90 };
91}