hosts/carbon: Change DSL uplink to netcologne
This commit is contained in:
@@ -4,11 +4,11 @@
|
||||
|
||||
services.pppd = {
|
||||
enable = true;
|
||||
peers.dtagdsl = {
|
||||
peers.ncfttb = {
|
||||
config = ''
|
||||
plugin pppoe.so net-dsl
|
||||
user "''${PPPD_DTAGDSL_USERNAME}"
|
||||
ifname ppp-dtagdsl
|
||||
user "''${PPPD_NETCOLOGNE_USERNAME}"
|
||||
ifname ppp-ncfttb
|
||||
persist
|
||||
maxfail 0
|
||||
holdoff 5
|
||||
@@ -24,9 +24,9 @@
|
||||
};
|
||||
};
|
||||
|
||||
environment.etc."ppp/peers/dtagdsl".enable = false;
|
||||
environment.etc."ppp/peers/ncfttb".enable = false;
|
||||
|
||||
systemd.services."pppd-dtagdsl".serviceConfig = let
|
||||
systemd.services."pppd-ncfttb".serviceConfig = let
|
||||
preStart = ''
|
||||
mkdir -p /etc/ppp/peers
|
||||
|
||||
@@ -34,22 +34,22 @@
|
||||
umask u=rw,g=,o=
|
||||
|
||||
# Copy config and substitute username
|
||||
rm -f /etc/ppp/peers/dtagdsl
|
||||
${pkgs.envsubst}/bin/envsubst -i "${config.environment.etc."ppp/peers/dtagdsl".source}" > /etc/ppp/peers/dtagdsl
|
||||
rm -f /etc/ppp/peers/ncfttb
|
||||
${pkgs.envsubst}/bin/envsubst -i "${config.environment.etc."ppp/peers/ncfttb".source}" > /etc/ppp/peers/ncfttb
|
||||
|
||||
# Copy login secrets
|
||||
rm -f /etc/ppp/pap-secrets
|
||||
cat ${config.sops.secrets.pppd-dtagdsl-secrets.path} > /etc/ppp/pap-secrets
|
||||
cat ${config.sops.secrets.pppd-ncfttb-secrets.path} > /etc/ppp/pap-secrets
|
||||
rm -f /etc/ppp/chap-secrets
|
||||
cat ${config.sops.secrets.pppd-dtagdsl-secrets.path} > /etc/ppp/chap-secrets
|
||||
cat ${config.sops.secrets.pppd-ncfttb-secrets.path} > /etc/ppp/chap-secrets
|
||||
'';
|
||||
|
||||
preStartFile = pkgs.writeShellApplication {
|
||||
name = "pppd-dtagdsl-pre-start";
|
||||
name = "pppd-ncfttb-pre-start";
|
||||
text = preStart;
|
||||
};
|
||||
in {
|
||||
EnvironmentFile = config.sops.secrets.pppd-dtagdsl-username.path;
|
||||
EnvironmentFile = config.sops.secrets.pppd-ncfttb-username.path;
|
||||
ExecStartPre = [
|
||||
# "+" marks script to be executed without priviledge restrictions
|
||||
"+${lib.getExe preStartFile}"
|
||||
|
||||
Reference in New Issue
Block a user