From 22940300fec1b4be169404422a60d3777a0c1491 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Fri, 7 Apr 2023 00:32:16 -0300 Subject: [PATCH] dwt1-shell-color-scripts: init at unstable-2023-03-27 --- .../misc/dwt1-shell-color-scripts/default.nix | 52 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 1 + 2 files changed, 53 insertions(+) create mode 100644 pkgs/tools/misc/dwt1-shell-color-scripts/default.nix diff --git a/pkgs/tools/misc/dwt1-shell-color-scripts/default.nix b/pkgs/tools/misc/dwt1-shell-color-scripts/default.nix new file mode 100644 index 00000000000..39a9187b3ba --- /dev/null +++ b/pkgs/tools/misc/dwt1-shell-color-scripts/default.nix @@ -0,0 +1,52 @@ +{ lib +, stdenvNoCC +, fetchFromGitLab +, installShellFiles +}: + +stdenvNoCC.mkDerivation { + pname = "dwt1-shell-color-scripts"; + version = "unstable-2023-03-27"; + + src = fetchFromGitLab { + owner = "dwt1"; + repo = "shell-color-scripts"; + rev = "576735cf656ece1bfd314e617b91c0e9d486d262"; + hash = "sha256-1iDcUv6uVq5LzFgZo36RRKqAzKoYKZW/MnlbneayvCY="; + }; + + nativeBuildInputs = [ installShellFiles ]; + + postPatch = '' + patchShebangs ./colorscript.sh + patchShebangs ./colorscripts + ''; + + installPhase = '' + runHook preInstall + + mkdir -p $out/bin $out/share/shell-color-scripts + install -Dm755 colorscript.sh $out/bin/colorscript + cp -r colorscripts $out/share/shell-color-scripts/colorscripts + + installManPage colorscript.1 + installShellCompletion --fish completions/colorscript.fish + installShellCompletion --zsh completions/_colorscript + + runHook postInstall + ''; + + postFixup = '' + substituteInPlace $out/bin/colorscript \ + --replace "/opt/shell-color-scripts/colorscripts" \ + "$out/share/shell-color-scripts/colorscripts" + ''; + + meta = { + homepage = "https://gitlab.com/dwt1/shell-color-scripts"; + description = "A collection of shell color scripts collected by dt (Derek Taylor)"; + license = with lib.licenses; [ mit ]; + maintainers = with lib.maintainers; [ ]; + platforms = lib.platforms.all; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index eab38d1faf1..5a57c735003 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4564,6 +4564,7 @@ with pkgs; dtools = callPackage ../development/tools/dtools { }; + dwt1-shell-color-scripts = callPackage ../tools/misc/dwt1-shell-color-scripts { }; dtrx = callPackage ../tools/compression/dtrx { };