summaryrefslogtreecommitdiff
path: root/sys/net.nix
diff options
context:
space:
mode:
Diffstat (limited to 'sys/net.nix')
-rw-r--r--sys/net.nix42
1 files changed, 0 insertions, 42 deletions
diff --git a/sys/net.nix b/sys/net.nix
deleted file mode 100644
index b441350..0000000
--- a/sys/net.nix
+++ /dev/null
@@ -1,42 +0,0 @@
-{ lib, config, pkgs, ... }:
-with lib; let
- cfg = config.local;
-in
-{
- options.local = with lib.types; {
- hostname = mkOption {
- type = str;
- };
-
- dhcpInterface = mkOption {
- type = nullOr str;
- default = null;
- };
- };
-
- config = {
- environment.systemPackages = [ pkgs.dhcpcd ];
-
- networking = {
- hostName = cfg.hostname;
-
- useDHCP = false;
- useNetworkd = true;
-
- wireguard.enable = true;
- };
-
- systemd.network.networks."40-${cfg.dhcpInterface}" = mkIf (cfg.dhcpInterface != null) {
- matchConfig.Name = cfg.dhcpInterface;
-
- networkConfig = {
- DHCP = "ipv4";
- IPv6AcceptRA = true;
- IPv6PrivacyExtensions = "kernel";
- };
-
- # make routing on this interface a dependency for network-online.target
- linkConfig.RequiredForOnline = "routable";
- };
- };
-}