1{
2 lib,
3 stdenvNoCC,
4 fetchFromGitHub,
5 makeWrapper,
6 nix-update-script,
7}:
8
9stdenvNoCC.mkDerivation {
10 pname = "cli-tips";
11 version = "0-unstable-2025-02-03";
12
13 src = fetchFromGitHub {
14 owner = "cli-stuff";
15 repo = "cli-tips";
16 rev = "34e37224b51362003d1c5af2b0b6bc2a02b668d9";
17 hash = "sha256-ZJQGa7gaR76zsdZOVoIf87h2wraFFOuonJEDy6J8ygQ=";
18 };
19
20 nativeBuildInputs = [ makeWrapper ];
21
22 dontBuild = true;
23
24 installPhase = ''
25 runHook preInstall
26
27 mkdir -p $out/share
28 install -Dm755 cli-tips.sh $out/bin/cli-tips
29 cp -r translations $out/share
30
31 runHook postInstall
32 '';
33
34 postInstall = ''
35 wrapProgram $out/bin/cli-tips \
36 --set TIPS_FOLDER "$out/share/translations"
37 '';
38
39 passthru.updateScript = nix-update-script {
40 extraArgs = [ "--version=branch" ];
41 };
42
43 meta = {
44 description = "CLI tool that provides useful tips and commands for Linux users";
45 homepage = "https://github.com/cli-stuff/cli-tips";
46 license = lib.licenses.unlicense;
47 platforms = with lib.platforms; linux ++ darwin ++ windows;
48 maintainers = with lib.maintainers; [ perchun ];
49 mainProgram = "cli-tips";
50 };
51}