summaryrefslogtreecommitdiff
path: root/hosts/vidhar/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'hosts/vidhar/default.nix')
-rw-r--r--hosts/vidhar/default.nix54
1 files changed, 41 insertions, 13 deletions
diff --git a/hosts/vidhar/default.nix b/hosts/vidhar/default.nix
index 7657c4a8..d9d44070 100644
--- a/hosts/vidhar/default.nix
+++ b/hosts/vidhar/default.nix
@@ -158,19 +158,47 @@
158 "eno2".networkConfig.LinkLocalAddressing = "no"; 158 "eno2".networkConfig.LinkLocalAddressing = "no";
159 "telekom".networkConfig.LinkLocalAddressing = "no"; 159 "telekom".networkConfig.LinkLocalAddressing = "no";
160 }; 160 };
161 services.dhcpd6 = { 161 systemd.services."dhcpcd-telekom" = {
162 enable = true; 162 wantedBy = [ "multi-user.target" "network-online.target" ];
163 configFile = pkgs.writeText "dhcpd6.conf" '' 163 bindsTo = [ "pppd-telekom.service" ];
164 interface dsl { 164 after = [ "pppd-telekom.service" ];
165 send ia-pd 0; 165 wants = [ "network.target" ];
166 }; 166 before = [ "network-online.target" ];
167 167
168 id-assoc pd 0 { 168 path = with pkgs; [ dhcpcd nettools openresolv ];
169 prefix-interface eno1 { 169 unitConfig.ConditionCapability = "CAP_NET_ADMIN";
170 sla-id 0; 170
171 }; 171 stopIfChanged = false;
172 }; 172
173 ''; 173 serviceConfig = let
174 dhcpcdConf = pkgs.writeText "dhcpcd.conf" ''
175 duid
176 persistent
177 vendorclassid
178
179 nooption domain_name_servers, domain_name, domain_search
180 option classless_static_routes
181 option interface_mtu
182
183 option host_name
184 option rapid_commit
185 require dhcp_server_identifier
186 slaac private
187
188 noipv6rs # disable routing solicitation
189 allowinterfaces dsl
190 interface dsl
191 ipv6rs # enable routing solicitation for WAN adapter
192 ia_na 1 # request an IPv6 address
193 ia_pd 1 eno1/0 # request a PD and assign it to the LAN
194 '';
195 in {
196 Type = "forking";
197 PIDFile = "/run/dhcpcd.pid";
198 ExecStart = "@${pkgs.dhcpcd}/sbin/dhcpcd dhcpcd --config ${dhcpcdConf}";
199 ExecReload = "${pkgs.dhcpcd}/sbin/dhcpcd --rebind";
200 Restart = "always";
201 };
174 }; 202 };
175 203
176 services.timesyncd.enable = false; 204 services.timesyncd.enable = false;