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";
|
nixpkgs.march = "silvermont";
|
||||||
nix.substituters = [ "https://cache.nixos.org/" "https://nix-store.chn.moe" ];
|
nix.substituters = [ "https://cache.nixos.org/" "https://nix-store.chn.moe" ];
|
||||||
kernel.patches = [ "cjktty" "lantian" ];
|
kernel.patches = [ "cjktty" "lantian" ];
|
||||||
networking.hostname = "nas";
|
networking = { hostname = "nas"; networkd.dhcp = [ "enp3s0" ]; };
|
||||||
gui.preferred = false;
|
gui.preferred = false;
|
||||||
};
|
};
|
||||||
hardware = { cpus = [ "intel" ]; gpu.type = "intel"; };
|
hardware = { cpus = [ "intel" ]; gpu.type = "intel"; };
|
||||||
|
@ -3,6 +3,8 @@ inputs:
|
|||||||
options.nixos.system.networking = let inherit (inputs.lib) mkOption types; in
|
options.nixos.system.networking = let inherit (inputs.lib) mkOption types; in
|
||||||
{
|
{
|
||||||
hostname = mkOption { type = types.nonEmptyStr; };
|
hostname = mkOption { type = types.nonEmptyStr; };
|
||||||
|
networkManager.enable = mkOption
|
||||||
|
{ type = types.bool; default = inputs.config.nixos.system.networking.networkd.dhcp == []; };
|
||||||
networkd =
|
networkd =
|
||||||
{
|
{
|
||||||
dhcp = mkOption { type = types.listOf types.nonEmptyStr; default = []; };
|
dhcp = mkOption { type = types.listOf types.nonEmptyStr; default = []; };
|
||||||
@ -12,20 +14,7 @@ inputs:
|
|||||||
[
|
[
|
||||||
# general config
|
# general config
|
||||||
{
|
{
|
||||||
networking =
|
networking.hostName = networking.hostname;
|
||||||
{
|
|
||||||
networkmanager =
|
|
||||||
{
|
|
||||||
enable = true;
|
|
||||||
# let networkmanager ignore the kernel command line `ip=xxx`
|
|
||||||
extraConfig =
|
|
||||||
''
|
|
||||||
[device]
|
|
||||||
keep-configuration=no
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
hostName = networking.hostname;
|
|
||||||
};
|
|
||||||
boot.kernel.sysctl =
|
boot.kernel.sysctl =
|
||||||
{
|
{
|
||||||
"net.core.rmem_max" = 67108864;
|
"net.core.rmem_max" = 67108864;
|
||||||
@ -48,6 +37,20 @@ inputs:
|
|||||||
"net.bridge.bridge-nf-call-arptables" = false;
|
"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
|
# networkd
|
||||||
(inputs.lib.mkIf (networking.networkd.dhcp != [])
|
(inputs.lib.mkIf (networking.networkd.dhcp != [])
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user