mirror of
https://github.com/CHN-beta/nixos.git
synced 2024-10-23 05:39:05 +08:00
devices.nas: switch to networkd
This commit is contained in:
parent
28f3976a48
commit
dce1220b24
@ -44,7 +44,7 @@ inputs:
|
||||
nixpkgs.march = "silvermont";
|
||||
nix.substituters = [ "https://cache.nixos.org/" "https://nix-store.chn.moe" ];
|
||||
kernel.patches = [ "cjktty" "lantian" ];
|
||||
networking.hostname = "nas";
|
||||
networking = { hostname = "nas"; networkd.dhcp = [ "enp3s0" ]; };
|
||||
gui.preferred = false;
|
||||
};
|
||||
hardware = { cpus = [ "intel" ]; gpu.type = "intel"; };
|
||||
|
@ -3,6 +3,8 @@ inputs:
|
||||
options.nixos.system.networking = let inherit (inputs.lib) mkOption types; in
|
||||
{
|
||||
hostname = mkOption { type = types.nonEmptyStr; };
|
||||
networkManager.enable = mkOption
|
||||
{ type = types.bool; default = inputs.config.nixos.system.networking.networkd.dhcp == []; };
|
||||
networkd =
|
||||
{
|
||||
dhcp = mkOption { type = types.listOf types.nonEmptyStr; default = []; };
|
||||
@ -12,20 +14,7 @@ inputs:
|
||||
[
|
||||
# general config
|
||||
{
|
||||
networking =
|
||||
{
|
||||
networkmanager =
|
||||
{
|
||||
enable = true;
|
||||
# let networkmanager ignore the kernel command line `ip=xxx`
|
||||
extraConfig =
|
||||
''
|
||||
[device]
|
||||
keep-configuration=no
|
||||
'';
|
||||
};
|
||||
hostName = networking.hostname;
|
||||
};
|
||||
networking.hostName = networking.hostname;
|
||||
boot.kernel.sysctl =
|
||||
{
|
||||
"net.core.rmem_max" = 67108864;
|
||||
@ -48,6 +37,20 @@ inputs:
|
||||
"net.bridge.bridge-nf-call-arptables" = false;
|
||||
};
|
||||
}
|
||||
# networkManager
|
||||
(inputs.lib.mkIf networking.networkManager.enable
|
||||
{
|
||||
networking.networkmanager =
|
||||
{
|
||||
enable = true;
|
||||
# let networkmanager ignore the kernel command line `ip=xxx`
|
||||
extraConfig =
|
||||
''
|
||||
[device]
|
||||
keep-configuration=no
|
||||
'';
|
||||
};
|
||||
})
|
||||
# networkd
|
||||
(inputs.lib.mkIf (networking.networkd.dhcp != [])
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user