From 3522351939a888a23c92d60c2a540a27f0b75cad Mon Sep 17 00:00:00 2001 From: Anna Aurora Date: Sun, 24 Dec 2023 15:16:59 +0100 Subject: [PATCH] colstr: init at 1.0.0 Co-authored-by: Donovan Glover Co-authored-by: Anderson Torres --- pkgs/by-name/co/colstr/package.nix | 45 ++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 pkgs/by-name/co/colstr/package.nix diff --git a/pkgs/by-name/co/colstr/package.nix b/pkgs/by-name/co/colstr/package.nix new file mode 100644 index 000000000000..a1ea23668277 --- /dev/null +++ b/pkgs/by-name/co/colstr/package.nix @@ -0,0 +1,45 @@ +{ lib +, stdenv +, fetchFromGitea +, nix-update-script +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "colstr"; + version = "1.0.0"; + + src = fetchFromGitea { + domain = "git.sleeping.town"; + owner = "wonder"; + repo = "colstr"; + rev = finalAttrs.version; + hash = "sha256-0V2S/yYu5L7qxkT4Zf18x9+cHoPMztFmgSywpxF8QqA="; + }; + + buildPhase = '' + runHook preBuild + + eval ${stdenv.cc.targetPrefix}c++ main.cpp + + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + + install -Dm755 a.out $out/bin/colstr + + runHook postInstall + ''; + + passthru.updateScript = nix-update-script { }; + + meta = with lib; { + description = "Deterministically output each input argument in a color assigned to it"; + homepage = "https://git.sleeping.town/wonder/colstr"; + license = with licenses; [ cc0 ]; + maintainers = with maintainers; [ annaaurora ]; + mainProgram = "colstr"; + platforms = platforms.all; + }; +})