liminix/tests/pppoe/configuration.nix

46 lines
1.1 KiB
Nix
Raw Normal View History

{ config, pkgs, lib, ... } :
2022-09-25 10:54:31 +00:00
let
inherit (pkgs.liminix.services) oneshot longrun bundle target output;
2023-09-01 16:55:08 +00:00
svc = config.system.service;
2022-09-25 10:54:31 +00:00
in rec {
2023-09-01 16:55:08 +00:00
services.lan4 = svc.network.address.build {
interface = config.hardware.networkInterfaces.lan;
family = "inet"; address ="192.168.19.1"; prefixLength = 24;
};
2023-07-14 21:23:11 +00:00
imports = [
../../modules/ppp
2023-07-14 21:53:25 +00:00
../../modules/dnsmasq
2023-09-01 16:55:08 +00:00
../../modules/network
2023-07-14 21:23:11 +00:00
];
2022-09-25 10:54:31 +00:00
services.pppoe =
2023-09-01 16:55:08 +00:00
svc.pppoe.build {
interface = config.hardware.networkInterfaces.wan;
ppp-options = [
"debug" "+ipv6" "noauth"
"name" "db123@a.1"
"password" "NotReallyTheSecret"
];
};
2022-09-25 10:54:31 +00:00
2023-09-01 16:55:08 +00:00
services.defaultroute4 = svc.network.route.build {
via = "$(output ${services.pppoe} address)";
2022-09-26 11:55:10 +00:00
target = "default";
dependencies = [ services.pppoe ];
};
2023-09-01 16:55:08 +00:00
services.packet_forwarding = svc.network.forward.build {
dependencies = [services.pppoe];
};
2022-09-25 10:54:31 +00:00
services.dns =
2023-09-01 16:55:08 +00:00
svc.dnsmasq.build {
interface = services.lan4;
ranges = ["192.168.19.10,192.168.19.253"];
domain = "fake.liminix.org";
};
defaultProfile.packages = [ pkgs.hello ] ;
2022-09-25 10:54:31 +00:00
}