about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNick Cao <nickcao@nichi.co>2023-01-16 18:38:48 +0800
committerGitHub <noreply@github.com>2023-01-16 18:38:48 +0800
commit25d107eb8e5f5c66a437fff1f3f67c38e2a5ecee (patch)
tree364e68f7f8c8213b743d83c951129ace7059389e
parent7ace93699593e301503be203da6085c67f333f33 (diff)
parentc98d09461e3781b633d0c1edca51d5cddced6c0b (diff)
Merge pull request #210866 from suominen/colorless
colorless: init at 109
-rw-r--r--maintainers/maintainer-list.nix6
-rw-r--r--pkgs/tools/misc/colorless/default.nix47
-rw-r--r--pkgs/top-level/all-packages.nix2
3 files changed, 55 insertions, 0 deletions
diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix
index a9121829cda05..cbfb5387e9e8e 100644
--- a/maintainers/maintainer-list.nix
+++ b/maintainers/maintainer-list.nix
@@ -13577,6 +13577,12 @@
     githubId = 16734772;
     name = "Sumner Evans";
   };
+  suominen = {
+    email = "kimmo@suominen.com";
+    github = "suominen";
+    githubId = 1939855;
+    name = "Kimmo Suominen";
+  };
   superbo = {
     email = "supernbo@gmail.com";
     github = "SuperBo";
diff --git a/pkgs/tools/misc/colorless/default.nix b/pkgs/tools/misc/colorless/default.nix
new file mode 100644
index 0000000000000..46e4745172ff9
--- /dev/null
+++ b/pkgs/tools/misc/colorless/default.nix
@@ -0,0 +1,47 @@
+{ lib
+, fetchurl
+, stdenvNoCC
+, coreutils
+, bash
+, binSh ? "${bash}/bin/bash"
+, gnused
+, less
+}:
+
+stdenvNoCC.mkDerivation rec {
+  pname = "colorless";
+  version = "109";
+
+  src = fetchurl {
+    url = "http://software.kimmo.suominen.com/${pname}-${version}.tar.gz";
+    sha256 = "039a140fa11cf153cc4d03e4f753b7ff142cab88ff116b7600ccf9edee81927c";
+  };
+
+  makeFlags = [
+    "TOOLPATH=${lib.makeBinPath [ coreutils gnused less ]}"
+    "PREFIX=$(out)"
+    "SHELL=${binSh}"
+  ];
+
+  preInstall = ''
+    mkdir -p $out/bin $out/share/man/man1
+  '';
+
+  postInstall = ''
+    install -Dm644 -t $out/share/doc/colorless LICENSE README.md
+  '';
+
+  strictDeps = true;
+
+  meta = with lib; {
+    homepage = "https://kimmo.suominen.com/sw/colorless";
+    description = "Enable colorised command output and pipe it to less";
+    longDescription = ''
+      colorless is a wrapper that enables colorised output of commands and
+      pipes the output to less(1).
+    '';
+    license = licenses.bsd2;
+    maintainers = with maintainers; [ suominen ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 98a181e7d1e04..37e57324b92c4 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -1350,6 +1350,8 @@ with pkgs;
 
   clematis = callPackage ../tools/misc/clematis { };
 
+  colorless = callPackage ../tools/misc/colorless { };
+
   cope = callPackage ../tools/misc/cope { };
 
   ejson2env = callPackage ../tools/admin/ejson2env { };