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 | 885e7857c0f3ac7dc7d73ceb6db6de9924f9b570 (patch) | |
tree | c32dfe8c530bbe4da8a7a09c76db9cd8d5192895 /tv | |
parent | 3f6a68eab4b49f16daf8373ee5d99b8ffd55a119 (diff) |
tv ppp: reconfigure resolv.conf
Diffstat (limited to 'tv')
-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 8c1dc65bc..ff61f943f 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 |