about summary refs log tree commit diff
path: root/pkgs/applications/networking/wgnord
diff options
context:
space:
mode:
authorColin Arnott <colin@urandom.co.uk>2022-12-30 10:12:07 +0000
committerColin Arnott <colin@urandom.co.uk>2023-01-08 03:45:17 +0000
commitdeead5ccfa24e8f48802414acaaf04beda0f19af (patch)
tree33d974076e2c6af77f840100f056fae59f539a9f /pkgs/applications/networking/wgnord
parentd87fcbe3cd948f8f1616723d2ed2e05f13ca13a5 (diff)
wgnord: init at 0.1.10
Fixes #201573
Diffstat (limited to 'pkgs/applications/networking/wgnord')
-rw-r--r--pkgs/applications/networking/wgnord/default.nix65
1 files changed, 65 insertions, 0 deletions
diff --git a/pkgs/applications/networking/wgnord/default.nix b/pkgs/applications/networking/wgnord/default.nix
new file mode 100644
index 0000000000000..b338cab2b3c46
--- /dev/null
+++ b/pkgs/applications/networking/wgnord/default.nix
@@ -0,0 +1,65 @@
+{ bash
+, coreutils
+, curl
+, fetchFromGitHub
+, gnugrep
+, gnused
+, iproute2
+, jq
+, lib
+, resholve
+, wireguard-tools
+}:
+
+resholve.mkDerivation rec {
+  pname = "wgnord";
+  version = "0.1.10";
+
+  src = fetchFromGitHub {
+    owner = "phirecc";
+    repo = pname;
+    rev = version;
+    hash = "sha256-T7dAEgi4tGvrzBABGLzKHhpCx0bxSCtTVI5iJJqJGlE=";
+  };
+
+  postPatch = ''
+    substituteInPlace wgnord \
+      --replace '$conf_dir/countries.txt' "$out/share/countries.txt" \
+      --replace '$conf_dir/countries_iso31662.txt' "$out/share/countries_iso31662.txt"
+  '';
+
+  dontBuild = true;
+
+  installPhase = ''
+    install -Dm 755 wgnord -t $out/bin/
+    install -Dm 644 countries.txt -t $out/share/
+    install -Dm 644 countries_iso31662.txt -t $out/share/
+  '';
+
+  solutions.default = {
+    scripts = [ "bin/wgnord" ];
+    interpreter = "${bash}/bin/sh";
+    inputs = [
+      coreutils
+      curl
+      gnugrep
+      gnused
+      iproute2
+      jq
+      wireguard-tools
+    ];
+    fix.aliases = true; # curl command in an alias
+    execer = [
+      "cannot:${iproute2}/bin/ip"
+      "cannot:${wireguard-tools}/bin/wg-quick"
+    ];
+  };
+
+  meta = with lib; {
+    description = "A NordVPN Wireguard (NordLynx) client in POSIX shell";
+    homepage = "https://github.com/phirecc/wgnord";
+    changelog = "https://github.com/phirecc/wgnord/releases/tag/v${version}";
+    maintainers = with lib.maintainers; [ urandom ];
+    license = licenses.mit;
+  };
+}