From c8d9af9f4a5ebafcccfe67311521ee456bb87599 Mon Sep 17 00:00:00 2001 From: Ana Hobden Date: Tue, 4 May 2021 07:15:54 -0700 Subject: [PATCH] t-rec: init at 0.6.0 Introduce [`t-rec`](https://github.com/sassman/t-rec-rs), a terminal recorder. Usage: ```bash nix run .#t-rec ``` Upon exit, `t-rec` will save recordings of the session to disk in GIF and MP4. Signed-off-by: Ana Hobden --- pkgs/misc/t-rec/default.nix | 34 +++++++++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 36 insertions(+) create mode 100644 pkgs/misc/t-rec/default.nix diff --git a/pkgs/misc/t-rec/default.nix b/pkgs/misc/t-rec/default.nix new file mode 100644 index 00000000000..cb8ccc8c6ae --- /dev/null +++ b/pkgs/misc/t-rec/default.nix @@ -0,0 +1,34 @@ +{ lib, imagemagick, ffmpeg, rustPlatform, fetchFromGitHub, makeWrapper }: + +let + binPath = lib.makeBinPath [ + imagemagick + ffmpeg + ]; +in +rustPlatform.buildRustPackage rec { + pname = "t-rec"; + version = "0.6.0"; + + src = fetchFromGitHub { + owner = "sassman"; + repo = "t-rec-rs"; + rev = "v${version}"; + sha256 = "InArrBqfhDrsonjmCIPTBVOA/s2vYml9Ay6cdrKLd7c="; + }; + + buildInputs = [ imagemagick ]; + nativeBuildInputs = [ makeWrapper ]; + postInstall = '' + wrapProgram "$out/bin/t-rec" --prefix PATH : "${binPath}" + ''; + + cargoSha256 = "4gwfrC65YlXV6Wu2ninK1TvMNUkY1GstVYPr0FK+xLU="; + + meta = with lib; { + description = "Blazingly fast terminal recorder that generates animated gif images for the web written in rust"; + homepage = "https://github.com/sassman/t-rec-rs"; + license = with licenses; [ gpl3Only ]; + maintainers = [ maintainers.hoverbear ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9fe55d433d1..22b9f9dd128 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -26424,6 +26424,8 @@ in lavalauncher = callPackage ../applications/misc/lavalauncher { }; + t-rec = callPackage ../misc/t-rec { }; + ulauncher = callPackage ../applications/misc/ulauncher { }; twinkle = qt5.callPackage ../applications/networking/instant-messengers/twinkle { };