summaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/da/darkhttpd/package.nix
blob: 462fe16592fdacc99c9f5c9c1b195d49f40e49e8 (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
28
29
30
31
32
33
34
35
36
{
  lib,
  stdenv,
  fetchFromGitHub,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "darkhttpd";
  version = "1.17";

  src = fetchFromGitHub {
    owner = "emikulic";
    repo = "darkhttpd";
    rev = "v${finalAttrs.version}";
    sha256 = "sha256-d5pDUY1EbVjykb4in4hhbgbjIXJtj133nRAQ84ASicQ=";
  };

  enableParallelBuilding = true;

  installPhase = ''
    runHook preInstall
    install -Dm555 -t $out/bin darkhttpd
    install -Dm444 -t $out/share/doc/darkhttpd README.md
    head -n 18 darkhttpd.c > $out/share/doc/darkhttpd/LICENSE
    runHook postInstall
  '';

  meta = {
    description = "Small and secure static webserver";
    mainProgram = "darkhttpd";
    homepage = "https://unix4lyfe.org/darkhttpd/";
    license = lib.licenses.bsd3;
    maintainers = with lib.maintainers; [ bobvanderlinden ];
    platforms = lib.platforms.all;
  };
})