14 stdenv.mkDerivation rec {
15 pname = "wireguard-tools";
16 version = "1.0.20210914";
19 url = "https://git.zx2c4.com/wireguard-tools/snapshot/wireguard-tools-${version}.tar.xz";
20 sha256 = "sha256-eGGkTVdPPTWK6iEyowW11F4ywRhd+0IXJTZCqY3OZws=";
23 outputs = [ "out" "man" ];
25 sourceRoot = "${src.name}/src";
27 nativeBuildInputs = [ makeWrapper ];
29 buildInputs = [ bash ];
34 "WITH_BASHCOMPLETION=yes"
35 "WITH_SYSTEMDUNITS=yes"
40 substituteInPlace $out/lib/systemd/system/wg-quick@.service \
41 --replace /usr/bin $out/bin
42 '' + lib.optionalString stdenv.hostPlatform.isLinux ''
43 for f in $out/bin/*; do
44 # Which firewall and resolvconf implementations to use should be determined by the
45 # environment, we provide the "default" ones as fallback.
47 --prefix PATH : ${lib.makeBinPath [ procps iproute2 ]} \
48 --suffix PATH : ${lib.makeBinPath [ iptables openresolv ]}
50 '' + lib.optionalString stdenv.hostPlatform.isDarwin ''
51 for f in $out/bin/*; do
53 --prefix PATH : ${lib.makeBinPath [ wireguard-go ]}
58 updateScript = ./update.sh;
59 tests = nixosTests.wireguard;
63 description = "Tools for the WireGuard secure network tunnel";
65 Supplies the main userspace tooling for using and configuring WireGuard tunnels, including the wg(8) and wg-quick(8) utilities.
66 - wg : the configuration utility for getting and setting the configuration of WireGuard tunnel interfaces. The interfaces
67 themselves can be added and removed using ip-link(8) and their IP addresses and routing tables can be set using ip-address(8)
68 and ip-route(8). The wg utility provides a series of sub-commands for changing WireGuard-specific aspects of WireGuard interfaces.
69 - wg-quick : an extremely simple script for easily bringing up a WireGuard interface, suitable for a few common use cases.
71 downloadPage = "https://git.zx2c4.com/wireguard-tools/refs/";
72 homepage = "https://www.wireguard.com/";
73 license = licenses.gpl2Only;
74 maintainers = with maintainers; [ ericsagnes zx2c4 globin ma27 d-xo ];
76 platforms = platforms.unix;