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

Packaging for NixOS #676

Open
spl3g opened this issue Mar 7, 2024 · 2 comments
Open

Packaging for NixOS #676

spl3g opened this issue Mar 7, 2024 · 2 comments

Comments

@spl3g
Copy link

spl3g commented Mar 7, 2024

Desktop (please complete the following information):

  • OS: NixOS
  • Version 24.05

Additional context
I am trying to package amnezia-client for NixOS. But there's no cqtdeployer there so the build script wouldn't have worked.
I think i figured out the dependencies and i built the AmneziaVPN and AmneziaVPN-service binaries that kind of work but when i try to connect to the server i get this error:

2024-03-07 23:45:38 debug Amnezia "WireguardUtilsLinux" "Tunnel process encountered an error: QProcess::FailedToStart"
2024-03-07 23:45:38 debug Amnezia "WireguardUtilsLinux" "Unable to start tunnel process due to timeout"
2024-03-07 23:45:38 debug Amnezia "Daemon" "Interface creation failed."
2024-03-07 23:45:38 debug Amnezia "DaemonLocalServerConnection" "Failed to activate the interface"

There's my package so far:

{ stdenv
, lib
, fetchFromGitHub
, cmake
, pkg-config
, libsecret
, libgcrypt
, openssl
, openvpn
, tun2socks
, cloak
, shadowsocks-libev
, wireguard-go
, xray
, qtbase
, wrapQtAppsHook
, qtremoteobjects
, qtsvg
, qttools
, qt5compat
, qtkeychain
}:

stdenv.mkDerivation rec {
  pname = "amnezia-client";
  version = "4.4.0.0";
  
  src = fetchFromGitHub {
    repo = "${pname}";
    owner = "amnezia-vpn";

    rev = "${version}";
    sha256 = "0k0sjf1c8iqg9crq4sfzdg4cczaq5pbk5j2873yzsw88rps0awac";
    fetchSubmodules = true;
  };
  
  nativeBuildInputs = [
    cmake
    wrapQtAppsHook
    pkg-config
  ];

  buildInputs = [
    qtbase
    qtremoteobjects
    qtsvg
    qttools
    qt5compat
    qtkeychain
    libsecret
    libgcrypt
    openssl
    openvpn
    tun2socks
    cloak
    shadowsocks-libev
    wireguard-go
    xray
  ];

  installPhase = ''
  runHook preInstall
  make install
  mkdir $out/bin
  mkdir -p $out/usr/share/{pixmaps,applications}
  cp client/AmneziaVPN $out/bin/
  cp service/server/AmneziaVPN-service $out/bin/
  runHook postInstall
  '';
}

I am not very familiar with cmake, c++ and qt so i think i am doing something wrong.

@chekoopa
Copy link

I'll bump this issue, as I am NixOS user and going to try Amnezia, so the client is cruical for me. Maybe I'll also look into it.

There also is a possible OS integration issue, as there are two components of the error message: fail to start tunnel process (due to some error yet to explore), and interface creation fail (which is also something to explore i.e. through dmesg).

@pokamest
Copy link
Member

Hi!
Does AmneziaVPN-service has enough privileges to create tun devices in your package?
It's running with sudo privileges when installed by installer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants