mirror of
https://github.com/CHN-beta/nixos.git
synced 2024-10-22 23:39:02 +08:00
modules.system.networking: fix dns
This commit is contained in:
parent
141e5e99f9
commit
17a5e27a49
@ -17,7 +17,7 @@ inputs:
|
|||||||
ip = mkOption { type = types.nonEmptyStr; };
|
ip = mkOption { type = types.nonEmptyStr; };
|
||||||
mask = mkOption { type = types.ints.unsigned; };
|
mask = mkOption { type = types.ints.unsigned; };
|
||||||
gateway = mkOption { type = types.nullOr types.nonEmptyStr; default = null; };
|
gateway = mkOption { type = types.nullOr types.nonEmptyStr; default = null; };
|
||||||
dns = mkOption { type = types.nonEmptyStr; default = null; };
|
dns = mkOption { type = types.nullOr types.nonEmptyStr; default = null; };
|
||||||
};});
|
};});
|
||||||
default = {};
|
default = {};
|
||||||
};
|
};
|
||||||
@ -95,6 +95,7 @@ inputs:
|
|||||||
routes = inputs.lib.mkIf (network.value.gateway != null)
|
routes = inputs.lib.mkIf (network.value.gateway != null)
|
||||||
[{ Gateway = network.value.gateway; Destination = "0.0.0.0/0"; }];
|
[{ Gateway = network.value.gateway; Destination = "0.0.0.0/0"; }];
|
||||||
linkConfig.RequiredForOnline = "routable";
|
linkConfig.RequiredForOnline = "routable";
|
||||||
|
dns = inputs.lib.mkIf (network.value.dns != null) [ network.value.dns ];
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
(inputs.localLib.attrsToList networking.networkd.static))
|
(inputs.localLib.attrsToList networking.networkd.static))
|
||||||
|
Loading…
Reference in New Issue
Block a user