about summary refs log tree commit diff
path: root/pkgs/servers/binserve/default.nix
blob: 3864c7929945f94ab94760e8cfd56950eadf599c (plain) (blame)
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
37
38
{ lib, stdenv, fetchFromGitHub, rustPlatform, CoreServices }:

rustPlatform.buildRustPackage rec {
  pname = "binserve";
  version = "0.2.0";

  src = fetchFromGitHub {
    owner = "mufeedvh";
    repo = pname;
    rev = "v${version}";
    sha256 = "sha256-Chm2xPB0BrLXSZslg9wnbDyHSJRQAvOtpH0Rw6w1q1s=";
  };

  buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [
    CoreServices
  ];

  cargoLock.lockFile = ./Cargo.lock;
  postPatch = ''
    cp ${./Cargo.lock} Cargo.lock
  '';

  doCheck = false;

  meta = with lib; {
    description = "Fast production-ready static web server";
    homepage = "https://github.com/mufeedvh/binserve";
    longDescription = ''
      A fast production-ready static web server with TLS
      (HTTPS), routing, hot reloading, caching, templating, and security in a
      single-binary you can set up with zero code
    '';
    license = licenses.mit;
    maintainers = with maintainers; [ snapdgn ];
    platforms = platforms.unix;
    mainProgram = "binserve";
  };
}