diff options
| author | Gregor Kleen <gkleen@yggdrasil.li> | 2021-11-15 09:07:04 +0059 |
|---|---|---|
| committer | Gregor Kleen <gkleen@yggdrasil.li> | 2021-11-15 09:07:04 +0059 |
| commit | 9663c40408fde29d5ca7ea9a71373bef4b16ae8c (patch) | |
| tree | c7b0392b6ebcac1ce00f6c15b608d96ae624b139 /hosts/vidhar/dsl.nix | |
| parent | 06d301e4387aee497604ca0567c53c68f1bfb31b (diff) | |
| download | nixos-9663c40408fde29d5ca7ea9a71373bef4b16ae8c.tar nixos-9663c40408fde29d5ca7ea9a71373bef4b16ae8c.tar.gz nixos-9663c40408fde29d5ca7ea9a71373bef4b16ae8c.tar.bz2 nixos-9663c40408fde29d5ca7ea9a71373bef4b16ae8c.tar.xz nixos-9663c40408fde29d5ca7ea9a71373bef4b16ae8c.zip | |
vidhar: dsl
Diffstat (limited to 'hosts/vidhar/dsl.nix')
| -rw-r--r-- | hosts/vidhar/dsl.nix | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/hosts/vidhar/dsl.nix b/hosts/vidhar/dsl.nix new file mode 100644 index 00000000..bdce55a6 --- /dev/null +++ b/hosts/vidhar/dsl.nix | |||
| @@ -0,0 +1,64 @@ | |||
| 1 | { config, lib, pkgs, ... }: | ||
| 2 | |||
| 3 | with lib; | ||
| 4 | |||
| 5 | let | ||
| 6 | pppInterface = config.networking.pppInterface; | ||
| 7 | in { | ||
| 8 | options = { | ||
| 9 | networking.pppInterface = mkOption { | ||
| 10 | type = types.str; | ||
| 11 | default = "dsl"; | ||
| 12 | }; | ||
| 13 | }; | ||
| 14 | |||
| 15 | config = { | ||
| 16 | networking.vlans = { | ||
| 17 | telekom = { | ||
| 18 | id = 7; | ||
| 19 | interface = "eno2"; | ||
| 20 | }; | ||
| 21 | }; | ||
| 22 | |||
| 23 | services.pppd = { | ||
| 24 | enable = true; | ||
| 25 | peers.telekom.config = '' | ||
| 26 | nodefaultroute | ||
| 27 | ifname ${pppInterface} | ||
| 28 | lcp-echo-failure 1 | ||
| 29 | lcp-echo-interval 1 | ||
| 30 | maxfail 0 | ||
| 31 | mtu 1492 | ||
| 32 | mru 1492 | ||
| 33 | plugin rp-pppoe.so | ||
| 34 | name telekom | ||
| 35 | user 002576900250551137425220#0001@t-online.de | ||
| 36 | telekom | ||
| 37 | debug | ||
| 38 | ''; | ||
| 39 | }; | ||
| 40 | systemd.services."pppd-telekom".serviceConfig = lib.mkForce { | ||
| 41 | ExecStart = "${lib.getBin pkgs.ppp}/sbin/pppd call telekom nodetach nolog"; | ||
| 42 | Restart = "always"; | ||
| 43 | RestartSec = 5; | ||
| 44 | |||
| 45 | RuntimeDirectory = "pppd"; | ||
| 46 | RuntimeDirectoryPreserve = true; | ||
| 47 | }; | ||
| 48 | sops.secrets."pap-secrets" = { | ||
| 49 | format = "binary"; | ||
| 50 | sopsFile = ./pap-secrets; | ||
| 51 | path = "/etc/ppp/pap-secrets"; | ||
| 52 | }; | ||
| 53 | |||
| 54 | environment.etc = { | ||
| 55 | "ppp/ip-up" = { | ||
| 56 | text = '' | ||
| 57 | #!${pkgs.runtimeShell} | ||
| 58 | ${pkgs.iproute}/bin/ip route add default via "$5" dev "${pppInterface}" metric 512 | ||
| 59 | ''; | ||
| 60 | mode = "0555"; | ||
| 61 | }; | ||
| 62 | }; | ||
| 63 | }; | ||
| 64 | } | ||
