quic-d
is an implementation of the QUIC protocol in Dlang.
The dependencies above can either be installed manually (in any way you prefer) or automatically via Nix.
This project uses a Nix_Flake-based development shell to specify the complete list of dependencies and precisely pin their versions. Note that this includes programs and libraries like the DMD and LDC D compilers, OpenSSL, and cURL, however D library dependencies are still managed by Dub (a future integration between Dub and Nix may allow Nix to manage all dependencies).
-
Install the Nix package manager.
-
Enable flakes.
-
Optionally, install and enable Direnv, see below.
-
Clone the project and enter the repo:
git clone https://github.com/dlang-community/quic-d && cd quic-d
-
At this point, if you have direnv enabled (as specified in step 3), the Nix development shell should have been automatically activated. If you, however, skipped this step, you will need to manually enter the shell like so:
nix develop
Assuming you have already entered the dev shell, you can use standard Dub commands to work on the project
-
Building the project:
dub build
-
Running the test suite:
dub test
For additional convenience, we recommend using Direnv, so that the
development shell will get automatically activated without the need for running
nix develop
each time one wants to work on the project.
-
Install direnv
nix-env -iA nixpkgs.direnv
-
Hook direnv to your shell.
-
Allow direnv to be used when inside the
quic-d
repo:direnv allow .
(replace.
with the location of the repo on your computer if needed)
This repo contains an .envrc
file which includes an integration between nix develop
and direnv (implemented by nix-direnv). The way this
works from user's perspective is that each time you cd
(or pushd
) into the
repo folder (or any nested dir), direnv will detect that and load the nearest
.envrc
file. Then the .envrc
file in this repo will activate the nix dev
shell in a subshell and then carry-over the environment variables to the current
shell. This only works if direnv is integrated with the current shell of the
user and if they have allowed the repo's .envrc
file to be loaded (this is
opt-in for security reasons.)