harcode paths for kpppoed, add port num in config

This commit is contained in:
Daniel Barlow 2023-02-17 00:09:02 +00:00
parent 40739d780b
commit 05576eeb94
3 changed files with 12 additions and 2 deletions

View file

@ -9,13 +9,14 @@
systemd.services.pppoe = systemd.services.pppoe =
let conf = pkgs.writeText "kpppoed.toml" let conf = pkgs.writeText "kpppoed.toml"
'' ''
interface_name = "eth0" interface_name = "eth1"
services = [ "myservice" ] services = [ "myservice" ]
lns_ipaddr = "90.155.53.19" lns_ipaddr = "90.155.53.19:1701"
ac_name = "kpppoed-1.0" ac_name = "kpppoed-1.0"
''; '';
in { in {
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
after = [ "network-online.target" ];
serviceConfig = { serviceConfig = {
ExecStart = "${pkgs.go-l2tp}/bin/kpppoed -config ${conf}"; ExecStart = "${pkgs.go-l2tp}/bin/kpppoed -config ${conf}";
}; };

View file

@ -26,6 +26,7 @@ final: prev: {
mips-vm = final.callPackage ./pkgs/mips-vm {}; mips-vm = final.callPackage ./pkgs/mips-vm {};
pppoe = final.callPackage ./pkgs/pppoe {}; pppoe = final.callPackage ./pkgs/pppoe {};
pppBuild = prev.ppp;
ppp = ppp =
(prev.ppp.override { (prev.ppp.override {
libpcap = null; libpcap = null;

View file

@ -1,6 +1,7 @@
{ {
buildGoModule buildGoModule
, fetchFromGitHub , fetchFromGitHub
, pppBuild
}: }:
buildGoModule rec { buildGoModule rec {
@ -13,6 +14,13 @@ buildGoModule rec {
rev = "570d763"; rev = "570d763";
hash= "sha256-R8ImKPkPBC+FvzKOBEZ3VxQ12dEjtfRa7AH94xMsAGA="; 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; doCheck = false;
vendorHash = "sha256-hOkhJhToN/VJwjQmnQJSPGz26/YDR2Ch+1yeW51OF+U="; vendorHash = "sha256-hOkhJhToN/VJwjQmnQJSPGz26/YDR2Ch+1yeW51OF+U=";