Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

amnezia-vpn: init at 4.8.2.3; nixos/programs/amnezia-vpn: init #367972

Merged
merged 1 commit into from
Jan 15, 2025

Conversation

sund3RRR
Copy link
Contributor

@sund3RRR sund3RRR commented Dec 24, 2024

Closes #338380

Amnezia is an open-source VPN client, with a key feature that enables you to deploy your own VPN server on your server.

Road map:

  • Build
  • Module
  • Release note
  • Check AmneziaWG
  • Check Wireguard
  • Check OpenVPN
  • Check OpenVPN over Cloak
  • Check OpenVPN over SS
  • Check XRay
  • Check ssh
  • Check split tunneling is working
  • Fix segmentation violation due to missing return (upstream PR)
  • Fix segmentation violation on Quit AmneziaVPN (I don't know how to fix this)

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Dec 24, 2024
@sund3RRR sund3RRR force-pushed the amneziaVPN-init branch 2 times, most recently from 7fb4d1f to 486afad Compare December 24, 2024 17:31
@sund3RRR sund3RRR force-pushed the amneziaVPN-init branch 2 times, most recently from 6011112 to f27aaab Compare December 24, 2024 17:42
@sund3RRR
Copy link
Contributor Author

It would be really cool if someone could help test this.

  1. clone my repo
git clone -b amneziaVPN-init [email protected]:sund3RRR/nixpkgs.git --depth 1
  1. enable amneziaVPN program in your configuration.nix
programs.amnezia-vpn.enable = true;
  1. rebuild from local nixpkgs
sudo nixos-rebuild -I nixpkgs=/absolute/path/to/your/nixpkgs test

@sund3RRR sund3RRR force-pushed the amneziaVPN-init branch 3 times, most recently from 59a4f84 to a63f578 Compare December 24, 2024 18:09
@ofborg ofborg bot added 8.has: package (new) This PR adds a new package 11.by: package-maintainer This PR was created by the maintainer of the package it changes 10.rebuild-darwin: 1 labels Dec 25, 2024
@sund3RRR
Copy link
Contributor Author

Added openvpn and tun2socks execution path patch. Unfortunately, this does not help.

XRay fails with 602 error, OpenVPN freeze on Connecting... state.

@sund3RRR
Copy link
Contributor Author

Got OpenVPN working

image

@sund3RRR sund3RRR force-pushed the amneziaVPN-init branch 2 times, most recently from 3dd57b4 to b2b17e6 Compare December 26, 2024 20:38
@sund3RRR
Copy link
Contributor Author

XRay is half working!
Working visually, not practically :D
Need to fix route add error
Screenshot_20241227_003431

@sund3RRR sund3RRR force-pushed the amneziaVPN-init branch 2 times, most recently from 6bb9f59 to c67a69f Compare December 27, 2024 11:34
@github-actions github-actions bot added 8.has: documentation This PR adds or changes documentation 8.has: changelog labels Dec 27, 2024
@sund3RRR sund3RRR marked this pull request as ready for review December 27, 2024 11:37
@sund3RRR sund3RRR changed the title amneziaVPN: init at 4.8.2.3; nixos/programs/amneziaVPN: init amnezia-vpn: init at 4.8.2.3; nixos/programs/amnezia-vpn: init Dec 27, 2024
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/5010

@github-actions github-actions bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin and removed 10.rebuild-darwin: 1-10 labels Dec 31, 2024
@sund3RRR sund3RRR requested a review from K900 January 1, 2025 15:28
@K900
Copy link
Contributor

K900 commented Jan 1, 2025

Have you submitted the patch upstream?

@sund3RRR
Copy link
Contributor Author

sund3RRR commented Jan 1, 2025

Have you submitted the patch upstream?

Now yes

Comment on lines 149 to 144
# install AmneziaVPN and AmneziaVPN-service
mkdir -p $out/bin
cp client/AmneziaVPN $out/bin/
cp service/server/AmneziaVPN-service $out/bin/
# install update-resolv-conf.sh
mkdir -p $out/local/bin
cp ../deploy/data/linux/client/bin/update-resolv-conf.sh $out/local/bin/
# install .desktop item
mkdir -p $out/share/applications
cp ../AppDir/AmneziaVPN.desktop $out/share/applications/
# install icon
mkdir -p $out/share/pixmaps/
cp ../deploy/data/linux/AmneziaVPN.png $out/share/pixmaps/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# install AmneziaVPN and AmneziaVPN-service
mkdir -p $out/bin
cp client/AmneziaVPN $out/bin/
cp service/server/AmneziaVPN-service $out/bin/
# install update-resolv-conf.sh
mkdir -p $out/local/bin
cp ../deploy/data/linux/client/bin/update-resolv-conf.sh $out/local/bin/
# install .desktop item
mkdir -p $out/share/applications
cp ../AppDir/AmneziaVPN.desktop $out/share/applications/
# install icon
mkdir -p $out/share/pixmaps/
cp ../deploy/data/linux/AmneziaVPN.png $out/share/pixmaps/
mkdir -p $out/bin $out/local/bin $out/share/applications $out/share/pixmaps/
cp client/AmneziaVPN service/server/AmneziaVPN-service $out/bin/
cp ../deploy/data/linux/client/bin/update-resolv-conf.sh $out/local/bin/
cp ../AppDir/AmneziaVPN.desktop $out/share/applications/
cp ../deploy/data/linux/AmneziaVPN.png $out/share/pixmaps/

$out/locan is a pretty none standard location for us

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this ok? I don't want update-resolv-conf.sh to be in bin/ because this script is not intended to be used outside the package

qtWrapperArgs = [
''--prefix PATH : ${
lib.makeBinPath [
busybox
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why busybox and note coreutils?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because ip an sysctl are needed

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might make sense to use procps and iproute2 instead. Not sure, didn't test

Copy link
Contributor

@LordGrimmauld LordGrimmauld Jan 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sund3RRR you might have overlooked this feedback, so i ping you again; can you try with procps and iproute2? That would imo be more reasonable than a dep on an alternative coreutils impl.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fine, it works! thank you

src = fetchFromGitHub {
owner = "amnezia-vpn";
repo = "amnezia-client";
rev = "refs/tags/${finalAttrs.version}";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
rev = "refs/tags/${finalAttrs.version}";
tag = finalAttrs.version;

src = fetchFromGitHub {
owner = "amnezia-vpn";
repo = "amnezia-xray-core";
rev = "v${finalAttrs.version}";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
rev = "v${finalAttrs.version}";
tag = "v${finalAttrs.version}";

src = fetchFromGitHub {
owner = "amnezia-vpn";
repo = "amnezia-tun2socks";
rev = "v${finalAttrs.version}";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
rev = "v${finalAttrs.version}";
tag = "v${finalAttrs.version}";

@sund3RRR sund3RRR force-pushed the amneziaVPN-init branch 2 times, most recently from 0a815ab to 8ff7bd9 Compare January 3, 2025 09:01
@LordGrimmauld
Copy link
Contributor

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 367972


x86_64-linux

⏩ 2 packages blacklisted:
  • nixos-install-tools
  • tests.nixos-functions.nixos-test
✅ 1 package built:
  • amnezia-vpn

@sund3RRR
Copy link
Contributor Author

@SuperSandro2000

@LordGrimmauld
Copy link
Contributor

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 367972


x86_64-linux

⏩ 1 package blacklisted:
  • nixos-install-tools
✅ 1 package built:
  • amnezia-vpn

Copy link
Contributor

@LordGrimmauld LordGrimmauld left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks reasonable to me now

@SuperSandro2000 SuperSandro2000 merged commit a0b256f into NixOS:master Jan 15, 2025
25 of 28 checks passed
@h7x4 h7x4 added the 8.has: module (new) This PR adds a module in `nixos/` label Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: changelog 8.has: documentation This PR adds or changes documentation 8.has: module (new) This PR adds a module in `nixos/` 8.has: module (update) This PR changes an existing module in `nixos/` 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 11.by: package-maintainer This PR was created by the maintainer of the package it changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Package request: AmneziaVPN-client
6 participants