-
Notifications
You must be signed in to change notification settings - Fork 404
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
Comments
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). |
Hi! |
any progress? |
Apparently the package names have changed since march, I updated --- /tmp/default.nix
+++ /tmp/amnezia/default.nix
@@ -12,13 +12,8 @@
, shadowsocks-libev
, wireguard-go
, xray
-, qtbase
-, wrapQtAppsHook
-, qtremoteobjects
-, qtsvg
-, qttools
-, qt5compat
-, qtkeychain
+, qt6
+, libsForQt5
}:
stdenv.mkDerivation rec {
@@ -36,17 +31,17 @@
nativeBuildInputs = [
cmake
- wrapQtAppsHook
+ qt6.wrapQtAppsHook
pkg-config
];
buildInputs = [
- qtbase
- qtremoteobjects
- qtsvg
- qttools
- qt5compat
- qtkeychain
+ qt6.qtbase
+ qt6.qtremoteobjects
+ qt6.qtsvg
+ qt6.qttools
+ qt6.qt5compat
+ libsForQt5.qtkeychain
libsecret
libgcrypt
openssl `default.nix`{ stdenv
, lib
, fetchFromGitHub
, cmake
, pkg-config
, libsecret
, libgcrypt
, openssl
, openvpn
, tun2socks
, cloak
, shadowsocks-libev
, wireguard-go
, xray
, qt6
, libsForQt5
}:
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
qt6.wrapQtAppsHook
pkg-config
];
buildInputs = [
qt6.qtbase
qt6.qtremoteobjects
qt6.qtsvg
qt6.qttools
qt6.qt5compat
libsForQt5.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 noticed several obvious problems in the current version of
tree /nix/store/964sfqdd47k92yxjbaa924szjijxmby8-amnezia-client-4.4.0.0
I ran the built package on user profile and regular Linux with the Command to build a package ( nix-build -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/6921160271c969939bdd82c46969ac9877ba9827.tar.gz -E 'with import <nixpkgs> {}; callPackage ./default.nix {}' |
Made a few more changes:
The final diff: diff -u a/default.nix b/default.nix
--- default.nix
+++ default.nix
@@ -8,17 +8,20 @@
, openssl
, openvpn
, tun2socks
-, cloak
+# , cloak # not the same one
+# only packaged on AUR https://github.com/amnezia-vpn/amnezia-client/issues/120
+# usage of prebuilt binaries!
, shadowsocks-libev
-, wireguard-go
+# , wireguard-go # not the same one
, xray
, qt6
, libsForQt5
+, breakpointHook
}:
stdenv.mkDerivation rec {
pname = "amnezia-client";
- version = "4.4.0.0";
+ version = "4.6.0.3";
src = fetchFromGitHub {
repo = "${pname}";
@@ -33,6 +36,7 @@
cmake
qt6.wrapQtAppsHook
pkg-config
+ breakpointHook
];
buildInputs = [
@@ -47,9 +51,9 @@
openssl
openvpn
tun2socks
- cloak
+# cloak # not the same one
shadowsocks-libev
- wireguard-go
+# wireguard-go # not the same one
xray
];
@@ -57,9 +61,18 @@
runHook preInstall
make install
mkdir $out/bin
- mkdir -p $out/usr/share/{pixmaps,applications}
+ mkdir -p $out/share/{pixmaps,applications}
+ mkdir -p $out/share/systemd/system/
cp client/AmneziaVPN $out/bin/
cp service/server/AmneziaVPN-service $out/bin/
+ cp ../deploy/data/linux/client/bin/update-resolv-conf.sh $out/bin/
+ cp ../deploy/data/linux/AmneziaVPN.png $out/share/pixmaps/
+ cp ../deploy/data/linux/AmneziaVPN.service $out/share/systemd/system/
+ cp ../deploy/data/deploy-prebuilt/linux/client/bin/ck-client $out/bin/
+ cp ../deploy/data/deploy-prebuilt/linux/client/bin/geoip.dat $out/bin/
+ cp ../deploy/data/deploy-prebuilt/linux/client/bin/geosite.dat $out/bin/
+ cp ../deploy/data/deploy-prebuilt/linux/client/bin/wireguard-go $out/bin/
+ cp ../AppDir/AmneziaVPN.desktop $out/share/applications/
runHook postInstall
'';
-}
\ No newline
+} `default.nix`{ stdenv
, lib
, fetchFromGitHub
, cmake
, pkg-config
, libsecret
, libgcrypt
, openssl
, openvpn
, tun2socks
# , cloak # not the same one
# only packaged on AUR https://github.com/amnezia-vpn/amnezia-client/issues/120
# usage of prebuilt binaries!
, shadowsocks-libev
# , wireguard-go # not the same one
, xray
, qt6
, libsForQt5
, breakpointHook
}:
stdenv.mkDerivation rec {
pname = "amnezia-client";
version = "4.6.0.3";
src = fetchFromGitHub {
repo = "${pname}";
owner = "amnezia-vpn";
rev = "${version}";
sha256 = "0k0sjf1c8iqg9crq4sfzdg4cczaq5pbk5j2873yzsw88rps0awac";
fetchSubmodules = true;
};
nativeBuildInputs = [
cmake
qt6.wrapQtAppsHook
pkg-config
breakpointHook
];
buildInputs = [
qt6.qtbase
qt6.qtremoteobjects
qt6.qtsvg
qt6.qttools
qt6.qt5compat
libsForQt5.qtkeychain
libsecret
libgcrypt
openssl
openvpn
tun2socks
# cloak # not the same one
shadowsocks-libev
# wireguard-go # not the same one
xray
];
installPhase = ''
runHook preInstall
make install
mkdir $out/bin
mkdir -p $out/share/{pixmaps,applications}
mkdir -p $out/share/systemd/system/
cp client/AmneziaVPN $out/bin/
cp service/server/AmneziaVPN-service $out/bin/
cp ../deploy/data/linux/client/bin/update-resolv-conf.sh $out/bin/
cp ../deploy/data/linux/AmneziaVPN.png $out/share/pixmaps/
cp ../deploy/data/linux/AmneziaVPN.service $out/share/systemd/system/
cp ../deploy/data/deploy-prebuilt/linux/client/bin/ck-client $out/bin/
cp ../deploy/data/deploy-prebuilt/linux/client/bin/geoip.dat $out/bin/
cp ../deploy/data/deploy-prebuilt/linux/client/bin/geosite.dat $out/bin/
cp ../deploy/data/deploy-prebuilt/linux/client/bin/wireguard-go $out/bin/
cp ../AppDir/AmneziaVPN.desktop $out/share/applications/
runHook postInstall
'';
} But the connection still fails:smiley: Amnezia-client is too heavily tied to I assume that A complete list of dependencies is needed to make it clear which of them are This issue cannot be fixed without the help of the main developers. |
Considering executable dependencies, we may add a patch to replace these calls with amnezia-client/client/utilities.cpp Lines 117 to 123 in ffe2314
|
Yes, I've made a little research on Nixpkgs and found a few nice examples of path replacement patches: |
If someone interested, I packaged kernel module, amneziawg-tools, amneziawg-go and updated wg-quick nixos module. |
If you're still interested, I've packaged cloak as |
Sorry, I would like to know about the promotion of AmneziaVPN-client. It still cannot be packaged for nixos? |
Hello, @ritascarlet , I assume it is already in unstable branch: https://search.nixos.org/packages?channel=unstable&sort=relevance&type=packages&query=amnezia |
Yes, but this is a CLI clients, the GUI client is not packaged yet |
If it's not difficult for you, then can you tell me how to use the clients currently in the repository correctly? I'm completely new to NixOs, Therefore, I do not understand what packages to install for my kernel (linux nixos 6.6.62) |
I think you should wait for NixOS/nixpkgs#341663. Or, if you want to use it right now, you can switch to unstable branch, add amneziawg tools to system packages, and add amneziawg to kernel packages. Then just use awg-quick cli tool. |
Great, I will try to do everything as you said, I will definitely wait for the client’s packaging. Thank you very much! |
There is also this PR NixOS/nixpkgs#360866 . |
I got it working NixOS/nixpkgs#338380 (comment) |
Desktop (please complete the following information):
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:
There's my package so far:
I am not very familiar with cmake, c++ and qt so i think i am doing something wrong.
The text was updated successfully, but these errors were encountered: