diff options
author | tv <tv@krebsco.de> | 2020-10-03 12:24:25 +0200 |
---|---|---|
committer | tv <tv@krebsco.de> | 2020-10-03 13:14:11 +0200 |
commit | 3411277b7c440c9f86b51283e6bab55c92161620 (patch) | |
tree | c25ed1422a26935526080e475d779f6e553c6e55 /tv/2configs | |
parent | 88869167655b17ccb0bbebfd854be41ff808f3df (diff) |
tv ppp: reconfigure resolv.conf
Diffstat (limited to 'tv/2configs')
-rw-r--r-- | tv/2configs/ppp.nix | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/tv/2configs/ppp.nix b/tv/2configs/ppp.nix index 8c1dc65..ff61f94 100644 --- a/tv/2configs/ppp.nix +++ b/tv/2configs/ppp.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: let +{ config, pkgs, ... }: let lib = import <stockholm/lib>; cfg = { pin = "@${toString <secrets/o2.pin>}"; @@ -6,6 +6,18 @@ ttys.com = "/dev/ttyACM1"; }; in { + assertions = [ + { + assertion = config.networking.resolvconf.enable; + message = "ppp configuration needs resolvconf"; + } + ]; + environment.etc."ppp/ip-up".source = pkgs.writeDash "ppp.ip-up" '' + ${pkgs.openresolv}/bin/resolvconf -a "$IFNAME" < /etc/ppp/resolv.conf + ''; + environment.etc."ppp/ip-down".source = pkgs.writeDash "ppp.ip-down" '' + ${pkgs.openresolv}/bin/resolvconf -fd "$IFNAME" + ''; environment.etc."ppp/peers/o2".text = /* sh */ '' ${cfg.ttys.ppp} 921600 |