From 3cc9bcb3386cec3a29af58cf361da2dc2fad7164 Mon Sep 17 00:00:00 2001 From: Gemini Lasswell Date: Thu, 27 Jun 2019 08:54:01 -0700 Subject: [PATCH] yggdrasil: init at 0.3.8 --- .../yggdrasil/change-runtime-dir.patch | 12 ++++++ pkgs/tools/networking/yggdrasil/default.nix | 37 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 3 files changed, 51 insertions(+) create mode 100644 pkgs/tools/networking/yggdrasil/change-runtime-dir.patch create mode 100644 pkgs/tools/networking/yggdrasil/default.nix diff --git a/pkgs/tools/networking/yggdrasil/change-runtime-dir.patch b/pkgs/tools/networking/yggdrasil/change-runtime-dir.patch new file mode 100644 index 000000000000..b4edc6a83871 --- /dev/null +++ b/pkgs/tools/networking/yggdrasil/change-runtime-dir.patch @@ -0,0 +1,12 @@ +diff -ruN a/src/defaults/defaults_linux.go b/src/defaults/defaults_linux.go +--- a/src/defaults/defaults_linux.go 2019-06-17 10:23:09.495613784 -0700 ++++ b/src/defaults/defaults_linux.go 2019-07-01 10:17:11.295669440 -0700 +@@ -7,7 +7,7 @@ + func GetDefaults() platformDefaultParameters { + return platformDefaultParameters{ + // Admin +- DefaultAdminListen: "unix:///var/run/yggdrasil.sock", ++ DefaultAdminListen: "unix:///var/run/yggdrasil/yggdrasil.sock", + + // Configuration (used for yggdrasilctl) + DefaultConfigFile: "/etc/yggdrasil.conf", diff --git a/pkgs/tools/networking/yggdrasil/default.nix b/pkgs/tools/networking/yggdrasil/default.nix new file mode 100644 index 000000000000..5a32d58ee4c4 --- /dev/null +++ b/pkgs/tools/networking/yggdrasil/default.nix @@ -0,0 +1,37 @@ +{ lib, buildGoModule, fetchFromGitHub }: + +buildGoModule rec { + pname = "yggdrasil"; + version = "0.3.8"; + + src = fetchFromGitHub { + owner = "yggdrasil-network"; + repo = "yggdrasil-go"; + rev = "v${version}"; + sha256 = "1jkbfx6mnzqqcqmdmll7bb44d94xa5iam704dpm2jmyk5pcvdhld"; + }; + + modSha256 = "0pjhr8ys05az4xryv9pxgzlsrqvghxn281a49g26xhsxp5pg1z32"; + + # Change the default location of the management socket on Linux + # systems so that the yggdrasil system service unit does not have to + # be granted write permission to /run. + patches = [ ./change-runtime-dir.patch ]; + + subPackages = [ "cmd/yggdrasil" "cmd/yggdrasilctl" ]; + + buildFlagsArray = '' + -ldflags= + -X github.com/yggdrasil-network/yggdrasil-go/src/version.buildVersion=${version} + -X github.com/yggdrasil-network/yggdrasil-go/src/version.buildName=${pname} + -s -w + ''; + + meta = with lib; { + description = "An experiment in scalable routing as an encrypted IPv6 overlay network"; + homepage = "https://yggdrasil-network.github.io/"; + license = licenses.lgpl3; + platforms = platforms.all; + maintainers = with maintainers; [ gazally lassulus ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b23103f5b688..45c63c44d81b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7262,6 +7262,8 @@ in yeshup = callPackage ../tools/system/yeshup { }; + yggdrasil = callPackage ../tools/networking/yggdrasil { }; + # To expose more packages for Yi, override the extraPackages arg. yi = callPackage ../applications/editors/yi/wrapper.nix { };