Skip to content

Commit

Permalink
wireguard: 0.0.20161209 -> 0.0.20161218
Browse files Browse the repository at this point in the history
  • Loading branch information
Mic92 committed Dec 19, 2016
1 parent c2e2a81 commit 9522e59
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 8 deletions.
9 changes: 8 additions & 1 deletion nixos/modules/services/networking/wireguard.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ let

options = {

package = mkOption {
type = types.path;
default = pkgs.wireguard;
defaultText = "pkgs.wireguard";
description = "Used wireguard package";
};

ips = mkOption {
example = [ "192.168.2.1/24" ];
default = [];
Expand Down Expand Up @@ -150,7 +157,7 @@ let
'';

ipCommand = "${pkgs.iproute}/bin/ip";
wgCommand = "${pkgs.wireguard}/bin/wg";
wgCommand = "${cfg.package}/bin/wg";

generateUnit = name: values:
nameValuePair "wireguard-${name}"
Expand Down
9 changes: 9 additions & 0 deletions pkgs/os-specific/linux/wireguard/0.0.20161209.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{ stdenv, fetchurl, libmnl, iproute, kernel ? null }:

# 0.0.20161216 introduced a non-backwards protocol change.
# this version is kept around to have a version compatible with nixos stable.
import ./generic.nix {
version = "0.0.20161209";
sha256 = "caabb9bb471a262e178162c30b8b8524cc3a05e0e9daf23a921870a4106ec886";
inherit stdenv fetchurl libmnl iproute kernel;
}
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
{ stdenv, fetchurl, libmnl, kernel ? null }:
{ stdenv, fetchurl, libmnl, iproute, kernel ? null, version, sha256 }:

# module requires Linux >= 4.1 https://www.wireguard.io/install/#kernel-requirements
assert kernel != null -> stdenv.lib.versionAtLeast kernel.version "4.1";

let
name = "wireguard-${version}";

version = "0.0.20161209";

src = fetchurl {
url = "https://git.zx2c4.com/WireGuard/snapshot/WireGuard-${version}.tar.xz";
sha256 = "11n8dq8a8w0qj8xg5np9w02kmk14hn5hphv2h4bjw9hs8yxvkaya";
inherit sha256;
};

meta = with stdenv.lib; {
homepage = https://www.wireguard.io/;
downloadPage = https://git.zx2c4.com/WireGuard/refs/;
description = "Fast, modern, secure VPN tunnel";
maintainers = with maintainers; [ ericsagnes ];
maintainers = with maintainers; [ ericsagnes mic92 ];
license = licenses.gpl2;
platforms = platforms.linux;
};
Expand Down Expand Up @@ -52,6 +50,14 @@ let
];

buildPhase = "make tools";
postInstall = ''
for i in ../contrib/examples/wg-config/*; do
dest="$out/bin/$(basename $i)"
install -m755 $i "$dest"
# avoid wrapper because tool resolve symlink to $0
sed -i "2iexport PATH=${iproute}/bin:\$PATH" "$dest"
done
'';
};

in if kernel == null
Expand Down
7 changes: 7 additions & 0 deletions pkgs/os-specific/linux/wireguard/latest.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{ stdenv, fetchurl, libmnl, iproute, kernel ? null }:

import ./generic.nix {
version = "0.0.20161218";
sha256 = "d805035d3e99768e69d8cdeb8fb5250a59b994ce127fceb71a078582c30f5597";
inherit stdenv fetchurl libmnl iproute kernel;
}
8 changes: 6 additions & 2 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11213,7 +11213,9 @@ in
virtualbox = pkgs.virtualboxHardened;
};

wireguard = callPackage ../os-specific/linux/wireguard { };
# kept for backwards compatibility with nixos 16.03
wireguard_0_0_20161209 = callPackage ../os-specific/linux/wireguard/0.0.20161209.nix { };
wireguard = callPackage ../os-specific/linux/wireguard/latest.nix { };

x86_energy_perf_policy = callPackage ../os-specific/linux/x86_energy_perf_policy { };

Expand Down Expand Up @@ -15261,7 +15263,9 @@ in

wings = callPackage ../applications/graphics/wings { };

wireguard = callPackage ../os-specific/linux/wireguard { };
# kept for backwards compatibility with nixos 16.03
wireguard_0_0_20161209 = callPackage ../os-specific/linux/wireguard/0.0.20161209.nix { };
wireguard = callPackage ../os-specific/linux/wireguard/latest.nix { };

wmname = callPackage ../applications/misc/wmname { };

Expand Down

0 comments on commit 9522e59

Please sign in to comment.