about summary refs log tree commit diff
path: root/pkgs/tools/misc/screenfetch
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2017-11-18 22:07:46 -0600
committerMatthew Bauer <mjbauer95@gmail.com>2017-11-18 22:08:33 -0600
commit11379283f1a39529a3d89f45a2cede0e0bc693d7 (patch)
treeed2244e6295bd2f47de0b528a01600805e18ff89 /pkgs/tools/misc/screenfetch
parente61b0cb1dfa4a1d48d22d14b777125164bcf4abe (diff)
downloadnixlib-11379283f1a39529a3d89f45a2cede0e0bc693d7.tar
nixlib-11379283f1a39529a3d89f45a2cede0e0bc693d7.tar.gz
nixlib-11379283f1a39529a3d89f45a2cede0e0bc693d7.tar.bz2
nixlib-11379283f1a39529a3d89f45a2cede0e0bc693d7.tar.lz
nixlib-11379283f1a39529a3d89f45a2cede0e0bc693d7.tar.xz
nixlib-11379283f1a39529a3d89f45a2cede0e0bc693d7.tar.zst
nixlib-11379283f1a39529a3d89f45a2cede0e0bc693d7.zip
screenfetch: fix darwin execution
Fixes #31790
Diffstat (limited to 'pkgs/tools/misc/screenfetch')
-rw-r--r--pkgs/tools/misc/screenfetch/default.nix28
1 files changed, 19 insertions, 9 deletions
diff --git a/pkgs/tools/misc/screenfetch/default.nix b/pkgs/tools/misc/screenfetch/default.nix
index 352fee14fa61..9ef0c9ebdf7d 100644
--- a/pkgs/tools/misc/screenfetch/default.nix
+++ b/pkgs/tools/misc/screenfetch/default.nix
@@ -1,5 +1,6 @@
-{ stdenv, fetchFromGitHub, makeWrapper, coreutils, gawk, procps, gnused
+{ stdenv, lib, fetchFromGitHub, makeWrapper, coreutils, gawk, procps, gnused
 , bc, findutils, xdpyinfo, xprop, gnugrep, ncurses
+, darwin
 }:
 
 stdenv.mkDerivation {
@@ -21,13 +22,22 @@ stdenv.mkDerivation {
     # Fix all of the depedencies of screenfetch
     patchShebangs $out/bin/screenfetch
     wrapProgram "$out/bin/screenfetch" \
-      --set PATH ${stdenv.lib.makeBinPath [
-        coreutils gawk procps gnused findutils xdpyinfo
-        xprop gnugrep ncurses bc
-      ]}
+      --set PATH ${lib.makeBinPath ([
+        coreutils gawk gnused findutils
+        gnugrep ncurses bc
+      ] ++ lib.optionals stdenv.isLinux [
+        procps
+        xdpyinfo
+        xprop
+      ] ++ lib.optionals stdenv.isDarwin (with darwin; [
+        adv_cmds
+        DarwinTools
+        system_cmds
+        "/usr" # some commands like defaults is not available to us
+      ]))}
   '';
 
-  meta = {
+  meta = with lib; {
     description = "Fetches system/theme information in terminal for Linux desktop screenshots";
     longDescription = ''
     screenFetch is a "Bash Screenshot Information Tool". This handy Bash
@@ -39,9 +49,9 @@ stdenv.mkDerivation {
     screenshot upon displaying info, and even customizing the screenshot
     command! This script is very easy to add to and can easily be extended.
     '';
-    license = stdenv.lib.licenses.gpl3;
+    license = licenses.gpl3;
     homepage = http://git.silverirc.com/cgit.cgi/screenfetch-dev.git/;
-    maintainers = with stdenv.lib.maintainers; [relrod];
-    platforms = stdenv.lib.platforms.all;
+    maintainers = with maintainers; [relrod];
+    platforms = platforms.all;
   };
 }