From 05576eeb94cf670459559834173e3c903a438311 Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Fri, 17 Feb 2023 00:09:02 +0000 Subject: [PATCH] harcode paths for kpppoed, add port num in config --- bordervm-configuration.nix | 5 +++-- overlay.nix | 1 + pkgs/go-l2tp/default.nix | 8 ++++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/bordervm-configuration.nix b/bordervm-configuration.nix index bbaa325..ffa6f50 100644 --- a/bordervm-configuration.nix +++ b/bordervm-configuration.nix @@ -9,13 +9,14 @@ systemd.services.pppoe = let conf = pkgs.writeText "kpppoed.toml" '' - interface_name = "eth0" + interface_name = "eth1" services = [ "myservice" ] - lns_ipaddr = "90.155.53.19" + lns_ipaddr = "90.155.53.19:1701" ac_name = "kpppoed-1.0" ''; in { wantedBy = [ "multi-user.target" ]; + after = [ "network-online.target" ]; serviceConfig = { ExecStart = "${pkgs.go-l2tp}/bin/kpppoed -config ${conf}"; }; diff --git a/overlay.nix b/overlay.nix index a477028..0c98d30 100644 --- a/overlay.nix +++ b/overlay.nix @@ -26,6 +26,7 @@ final: prev: { mips-vm = final.callPackage ./pkgs/mips-vm {}; pppoe = final.callPackage ./pkgs/pppoe {}; + pppBuild = prev.ppp; ppp = (prev.ppp.override { libpcap = null; diff --git a/pkgs/go-l2tp/default.nix b/pkgs/go-l2tp/default.nix index 93ab584..297fc8c 100644 --- a/pkgs/go-l2tp/default.nix +++ b/pkgs/go-l2tp/default.nix @@ -1,6 +1,7 @@ { buildGoModule , fetchFromGitHub +, pppBuild }: buildGoModule rec { @@ -13,6 +14,13 @@ buildGoModule rec { rev = "570d763"; hash= "sha256-R8ImKPkPBC+FvzKOBEZ3VxQ12dEjtfRa7AH94xMsAGA="; }; + + patchPhase = '' + sed -i.bak -e 's:/usr/sbin/pppd:${pppBuild}/bin/pppd:' cmd/kl2tpd/pppd.go + sed -i.bak -e 's:/usr/sbin/kl2tpd:${placeholder "out"}/bin/kl2tpd:' cmd/kpppoed/l2tpd_kl2tpd.go + grep bin/kl2tp cmd/kpppoed/l2tpd_kl2tpd.go + ''; + doCheck = false; vendorHash = "sha256-hOkhJhToN/VJwjQmnQJSPGz26/YDR2Ch+1yeW51OF+U=";