mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-12 04:35:41 +03:00
amnezia-vpn: fix openvpn; refactor install and fixup
This commit is contained in:
parent
dc52ceb7eb
commit
b4fc0f82bc
2 changed files with 33 additions and 27 deletions
|
@ -10,16 +10,24 @@ in
|
||||||
{
|
{
|
||||||
options.programs.amnezia-vpn = {
|
options.programs.amnezia-vpn = {
|
||||||
enable = lib.mkEnableOption "The AmneziaVPN client";
|
enable = lib.mkEnableOption "The AmneziaVPN client";
|
||||||
|
package = lib.mkPackageOption pkgs "amnezia-vpn" { };
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
environment.systemPackages = [ pkgs.amnezia-vpn ];
|
environment.systemPackages = [ cfg.package ];
|
||||||
services.dbus.packages = [ pkgs.amnezia-vpn ];
|
services.dbus.packages = [ cfg.package ];
|
||||||
services.resolved.enable = true;
|
services.resolved.enable = true;
|
||||||
|
|
||||||
systemd = {
|
systemd = {
|
||||||
packages = [ pkgs.amnezia-vpn ];
|
packages = [ cfg.package ];
|
||||||
services."AmneziaVPN".wantedBy = [ "multi-user.target" ];
|
services."AmneziaVPN" = {
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
path = with pkgs; [
|
||||||
|
procps
|
||||||
|
iproute2
|
||||||
|
sudo
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -12,14 +12,12 @@
|
||||||
shadowsocks-rust,
|
shadowsocks-rust,
|
||||||
cloak-pt,
|
cloak-pt,
|
||||||
wireguard-tools,
|
wireguard-tools,
|
||||||
procps,
|
|
||||||
iproute2,
|
|
||||||
sudo,
|
|
||||||
libssh,
|
libssh,
|
||||||
zlib,
|
zlib,
|
||||||
tun2socks,
|
tun2socks,
|
||||||
xray,
|
xray,
|
||||||
nix-update-script,
|
nix-update-script,
|
||||||
|
bash,
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
amnezia-tun2socks = tun2socks.overrideAttrs (
|
amnezia-tun2socks = tun2socks.overrideAttrs (
|
||||||
|
@ -83,7 +81,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||||
substituteInPlace client/configurators/openvpn_configurator.cpp \
|
substituteInPlace client/configurators/openvpn_configurator.cpp \
|
||||||
--replace-fail ".arg(qApp->applicationDirPath());" ".arg(\"$out/libexec\");"
|
--replace-fail ".arg(qApp->applicationDirPath());" ".arg(\"$out/libexec\");"
|
||||||
substituteInPlace client/ui/qautostart.cpp \
|
substituteInPlace client/ui/qautostart.cpp \
|
||||||
--replace-fail "/usr/share/pixmaps/AmneziaVPN.png" "$out/share/pixmaps/AmneziaVPN.png"
|
--replace-fail "/usr/share/pixmaps/AmneziaVPN.png" "AmneziaVPN"
|
||||||
substituteInPlace deploy/installer/config/AmneziaVPN.desktop.in \
|
substituteInPlace deploy/installer/config/AmneziaVPN.desktop.in \
|
||||||
--replace-fail "/usr/share/pixmaps/AmneziaVPN.png" "$out/share/pixmaps/AmneziaVPN.png"
|
--replace-fail "/usr/share/pixmaps/AmneziaVPN.png" "$out/share/pixmaps/AmneziaVPN.png"
|
||||||
substituteInPlace deploy/data/linux/AmneziaVPN.service \
|
substituteInPlace deploy/data/linux/AmneziaVPN.service \
|
||||||
|
@ -107,31 +105,31 @@ stdenv.mkDerivation (finalAttrs: {
|
||||||
];
|
];
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
|
bash
|
||||||
|
kdePackages.qt5compat
|
||||||
|
kdePackages.qtremoteobjects
|
||||||
|
kdePackages.qtsvg
|
||||||
libsecret
|
libsecret
|
||||||
qt6.qtbase
|
qt6.qtbase
|
||||||
qt6.qttools
|
qt6.qttools
|
||||||
kdePackages.qtremoteobjects
|
|
||||||
kdePackages.qtsvg
|
|
||||||
kdePackages.qt5compat
|
|
||||||
];
|
];
|
||||||
|
|
||||||
qtWrapperArgs = [
|
installPhase = ''
|
||||||
''--prefix PATH : ${
|
runHook preInstall
|
||||||
lib.makeBinPath [
|
|
||||||
procps
|
|
||||||
iproute2
|
|
||||||
sudo
|
|
||||||
]
|
|
||||||
}''
|
|
||||||
];
|
|
||||||
|
|
||||||
postInstall = ''
|
|
||||||
mkdir -p $out/bin $out/libexec $out/share/applications $out/share/pixmaps $out/lib/systemd/system
|
mkdir -p $out/bin $out/libexec $out/share/applications $out/share/pixmaps $out/lib/systemd/system
|
||||||
cp client/AmneziaVPN service/server/AmneziaVPN-service $out/bin/
|
install -m555 client/AmneziaVPN service/server/AmneziaVPN-service $out/bin/
|
||||||
cp ../deploy/data/linux/client/bin/update-resolv-conf.sh $out/libexec/
|
install -m555 ../deploy/data/linux/client/bin/update-resolv-conf.sh $out/libexec/
|
||||||
cp ../AppDir/AmneziaVPN.desktop $out/share/applications/
|
install -m444 ../AppDir/AmneziaVPN.desktop $out/share/applications/
|
||||||
cp ../deploy/data/linux/AmneziaVPN.png $out/share/pixmaps/
|
install -m444 ../deploy/data/linux/AmneziaVPN.png $out/share/pixmaps/
|
||||||
cp ../deploy/data/linux/AmneziaVPN.service $out/lib/systemd/system/
|
install -m444 ../deploy/data/linux/AmneziaVPN.service $out/lib/systemd/system/
|
||||||
|
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
|
||||||
|
postFixup = ''
|
||||||
|
# Temporary unwrap non-binary executable until qt6.wrapQtAppsHook is fixed
|
||||||
|
mv $out/libexec/.update-resolv-conf.sh-wrapped $out/libexec/update-resolv-conf.sh
|
||||||
'';
|
'';
|
||||||
|
|
||||||
passthru = {
|
passthru = {
|
||||||
|
@ -149,7 +147,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "Amnezia VPN Client";
|
description = "Amnezia VPN Client";
|
||||||
downloadPage = "https://amnezia.org/en/downloads";
|
downloadPage = "https://amnezia.org/en/downloads";
|
||||||
homepage = "https://amnezia.org/en";
|
homepage = "https://github.com/amnezia-vpn/amnezia-client";
|
||||||
license = licenses.gpl3;
|
license = licenses.gpl3;
|
||||||
mainProgram = "AmneziaVPN";
|
mainProgram = "AmneziaVPN";
|
||||||
maintainers = with maintainers; [ sund3RRR ];
|
maintainers = with maintainers; [ sund3RRR ];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue