3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/networking/mullvad/libwg.nix
Cole Helbling 2d53cad9d1 mullvad: init at 2022.1
This package includes the CLI binaries for mullvad, but does not attempt
to build the GUI. This allows it to be (more) cross-platform than the
mullvad-vpn package, which depends on a tool that is unavailable for
e.g. ARM platforms.
2022-04-01 07:39:16 -07:00

36 lines
905 B
Nix

{ lib
, buildGoModule
, fetchFromGitHub
, mullvad
}:
buildGoModule {
pname = "libwg";
inherit (mullvad)
version
src
;
sourceRoot = "source/wireguard/libwg";
vendorSha256 = "qvymWCdJ+GY90W/Fpdp+r1+mTq6O4LyN2Yw/PjKdFm0=";
# XXX: hack to make the ar archive go to the correct place
# This is necessary because passing `-o ...` to `ldflags` does not work
# (this doesn't get communicated everywhere in the chain, apparently, so
# `go` complains that it can't find an `a.out` file).
GOBIN = "${placeholder "out"}/lib";
ldflags = [ "-s" "-w" "-buildmode=c-archive" ];
postInstall = ''
mv $out/lib/libwg{,.a}
'';
meta = with lib; {
description = "A tiny wrapper around wireguard-go";
homepage = "https://github.com/mullvad/mullvadvpn-app/tree/master/wireguard/libwg";
license = licenses.gpl3Only;
maintainers = with maintainers; [ cole-h ];
};
}