diff --git a/examples/rotuer.nix b/examples/rotuer.nix index 3f2880da..06d5fefe 100644 --- a/examples/rotuer.nix +++ b/examples/rotuer.nix @@ -14,7 +14,6 @@ let dnsmasq hostapd interface - pppoe route; inherit (pkgs.liminix.services) oneshot longrun bundle target; inherit (pkgs) @@ -35,16 +34,12 @@ in rec { imports = [ ../modules/wlan.nix ../modules/standard.nix + ../modules/ppp.nix ]; rootfsType = "jffs2"; hostname = "rotuer"; kernel = { config = { - PPP = "y"; - PPP_BSDCOMP = "y"; - PPP_DEFLATE = "y"; - PPP_ASYNC = "y"; - PPP_SYNC_TTY = "y"; BRIDGE = "y"; NETFILTER_XT_MATCH_CONNTRACK = "y"; @@ -196,7 +191,7 @@ in rec { services.wan = let iface = config.hardware.networkInterfaces.wan; - in pppoe iface { + in config.system.service.pppoe iface { ppp-options = [ "debug" "+ipv6" "noauth" "name" secrets.l2tp.name diff --git a/modules/ppp.nix b/modules/ppp.nix new file mode 100644 index 00000000..08519e4c --- /dev/null +++ b/modules/ppp.nix @@ -0,0 +1,24 @@ +{ lib, pkgs, config, ...}: +let + inherit (lib) mkEnableOption mkOption types isDerivation hasAttr ; + inherit (pkgs.pseudofile) dir symlink; + inherit (pkgs) stdenv wireless-regdb; +in { + options = { + system.service.pppoe = mkOption { + type = types.functionTo (types.functionTo types.package); + }; + }; + config = { + system.service.pppoe = pkgs.liminix.networking.pppoe; + kernel = { + config = { + PPP = "y"; + PPP_BSDCOMP = "y"; + PPP_DEFLATE = "y"; + PPP_ASYNC = "y"; + PPP_SYNC_TTY = "y"; + }; + }; + }; +}