diff --git a/pkgs/tools/networking/wireguard-go/default.nix b/pkgs/tools/networking/wireguard-go/default.nix new file mode 100644 index 00000000000..28acdefd7b5 --- /dev/null +++ b/pkgs/tools/networking/wireguard-go/default.nix @@ -0,0 +1,27 @@ +{ stdenv, buildGoPackage, fetchurl }: + +buildGoPackage rec { + name = "wireguard-go-${version}"; + version = "0.0.20180514"; + + goPackagePath = "wireguard-go"; + + src = fetchurl { + url = "https://git.zx2c4.com/wireguard-go/snapshot/wireguard-go-${version}.tar.xz"; + sha256 = "1bn49a67m2ab0l9lq3zh2mfbbppmyg34klqi3069sjn6lg2hlajs"; + }; + + goDeps = ./deps.nix; + + patchPhase = '' + # Replace local imports so that go tools do not trip on them + find . -name '*.go' -exec sed -i '/import (/,/)/s@"./@"${goPackagePath}/@' {} \; + ''; + + meta = with stdenv.lib; { + description = "Userspace Go implementation of WireGuard"; + homepage = https://git.zx2c4.com/wireguard-go/about/; + license = licenses.gpl2; + platforms = with platforms; linux ++ darwin ++ windows; + }; +} diff --git a/pkgs/tools/networking/wireguard-go/deps.nix b/pkgs/tools/networking/wireguard-go/deps.nix new file mode 100644 index 00000000000..e480896f664 --- /dev/null +++ b/pkgs/tools/networking/wireguard-go/deps.nix @@ -0,0 +1,30 @@ +# This file was generated by https://github.com/kamilchm/go2nix v1.2.1 +[ + { + goPackagePath = "golang.org/x/crypto"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/crypto"; + rev = "1a580b3eff7814fc9b40602fd35256c63b50f491"; + sha256 = "11adgxc6fzcb3dxr5v2g4nk6ggrz04qnx633hzgmzfh2wv3blgv7"; + }; + } + { + goPackagePath = "golang.org/x/net"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/net"; + rev = "2491c5de3490fced2f6cff376127c667efeed857"; + sha256 = "1wmijnrxi9p2rv8g6clqkzdihn5ncv29j0s4s1bz9ksncdr36ll3"; + }; + } + { + goPackagePath = "golang.org/x/sys"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/sys"; + rev = "7c87d13f8e835d2fb3a70a2912c811ed0c1d241b"; + sha256 = "03fhkng37rczqwfgah5hd7d373jps3hcfx79dmky2fh62yvpcyn3"; + }; + } +] diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 63e9be24226..2129477e4b6 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5718,6 +5718,8 @@ with pkgs; wipe = callPackage ../tools/security/wipe { }; + wireguard-go = callPackage ../tools/networking/wireguard-go { }; + wkhtmltopdf = callPackage ../tools/graphics/wkhtmltopdf { overrideDerivation = lib.overrideDerivation; };