Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 lib,
3 stdenv,
4 fetchFromGitea,
5 nix-update-script,
6}:
7
8stdenv.mkDerivation (finalAttrs: {
9 pname = "colstr";
10 version = "1.0.0";
11
12 src = fetchFromGitea {
13 domain = "git.sleeping.town";
14 owner = "wonder";
15 repo = "colstr";
16 rev = finalAttrs.version;
17 hash = "sha256-0V2S/yYu5L7qxkT4Zf18x9+cHoPMztFmgSywpxF8QqA=";
18 };
19
20 buildPhase = ''
21 runHook preBuild
22
23 eval ${stdenv.cc.targetPrefix}c++ main.cpp
24
25 runHook postBuild
26 '';
27
28 installPhase = ''
29 runHook preInstall
30
31 install -Dm755 a.out $out/bin/colstr
32
33 runHook postInstall
34 '';
35
36 passthru.updateScript = nix-update-script { };
37
38 meta = with lib; {
39 description = "Deterministically output each input argument in a color assigned to it";
40 homepage = "https://git.sleeping.town/wonder/colstr";
41 license = with licenses; [ cc0 ];
42 maintainers = with maintainers; [ annaaurora ];
43 mainProgram = "colstr";
44 platforms = platforms.all;
45 };
46})