nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
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 (finalAttrs: {
50 pname = "screenfetch";
51 version = "3.9.9";
52
53 src = fetchFromGitHub {
54 owner = "KittyKatt";
55 repo = "screenFetch";
56 rev = "v${finalAttrs.version}";
57 sha256 = "sha256-UNZMCLXhH4wDV0/fGWsB+KAi6aJVuPs6zpWXIQAqnjo=";
58 };
59
60 nativeBuildInputs = [ makeWrapper ];
61
62 installPhase = ''
63 runHook preInstall
64
65 install -Dm 0755 screenfetch-dev $out/bin/screenfetch
66 install -Dm 0644 screenfetch.1 $out/share/man/man1/screenfetch.1
67 install -Dm 0644 -t $out/share/doc/screenfetch CHANGELOG COPYING README.mkdn TODO
68
69 # Fix all of the dependencies of screenfetch
70 patchShebangs $out/bin/screenfetch
71 wrapProgram "$out/bin/screenfetch" \
72 --prefix PATH : ${path}
73
74 runHook postInstall
75 '';
76
77 outputs = [
78 "out"
79 "doc"
80 "man"
81 ];
82
83 meta = {
84 description = "Fetches system/theme information in terminal for Linux desktop screenshots";
85 longDescription = ''
86 screenFetch is a "Bash Screenshot Information Tool". This handy Bash
87 script can be used to generate one of those nifty terminal theme
88 information + ASCII distribution logos you see in everyone's screenshots
89 nowadays. It will auto-detect your distribution and display an ASCII
90 version of that distribution's logo and some valuable information to the
91 right. There are options to specify no ascii art, colors, taking a
92 screenshot upon displaying info, and even customizing the screenshot
93 command! This script is very easy to add to and can easily be extended.
94 '';
95 license = lib.licenses.gpl3;
96 homepage = "https://github.com/KittyKatt/screenFetch";
97 maintainers = with lib.maintainers; [ relrod ];
98 platforms = lib.platforms.all;
99 mainProgram = "screenfetch";
100 };
101})