summaryrefslogtreecommitdiff
path: root/pkgs/human-sleep/default.nix
blob: 0a7db19ec66bbc8e0f3b6d5d5e8ef2d5384d277c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{
  stdenv,
  lib,
}:
stdenv.mkDerivation {
  pname = "human-sleep";
  version = "16-11-2024"; # Date of last change

  src = ./.;
  buildPhase = ''
    cc human-sleep.c -Wall -Wextra -o human-sleep
  '';

  # TODO: Run check phase: `cscript -DTEST human-sleep.c`

  installPhase = ''
    mkdir -p $out/bin
    mv human-sleep $out/bin/human-sleep
    ln -s human-sleep $out/bin/hsleep
  '';

  meta = with lib; {
    description = "Variant of the classic 'sleep' command that accepts suffixed numbers like '5 minutes'";
    license = licenses.unlicense;
    mainProgram = "human-sleep";
  };
}