system: add config for networking and hardware
This commit is contained in:
parent
6de9934ffe
commit
049fd348b2
8 changed files with 118 additions and 17 deletions
21
modules/system/os/networking/module.nix
Normal file
21
modules/system/os/networking/module.nix
Normal file
|
@ -0,0 +1,21 @@
|
|||
{config, ...}: let
|
||||
inherit (config.modules.other.system) username;
|
||||
in {
|
||||
imports = [
|
||||
./networkmanager.nix
|
||||
];
|
||||
networking = {
|
||||
enableIPv6 = true;
|
||||
nameservers = [
|
||||
# quad9 DNS
|
||||
"9.9.9.9"
|
||||
"2620::fe::fe"
|
||||
];
|
||||
};
|
||||
services.resolved = {
|
||||
enable = true;
|
||||
# quad9 dns
|
||||
fallbackDns = ["9.9.9.9" "2620::fe::fe"];
|
||||
};
|
||||
users.users.${username}.extraGroups = ["networkmanager"];
|
||||
}
|
26
modules/system/os/networking/networkmanager.nix
Normal file
26
modules/system/os/networking/networkmanager.nix
Normal file
|
@ -0,0 +1,26 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib) mkForce;
|
||||
in {
|
||||
networking.networkmanager = {
|
||||
enable = true;
|
||||
# Removes about 2GB of stuff we do no need.
|
||||
plugins = mkForce [];
|
||||
|
||||
dns = "systemd-resolved";
|
||||
unmanaged = [
|
||||
# DO NOT manage my docker containers, thank you.
|
||||
"interface-name:docker*"
|
||||
];
|
||||
wifi = {
|
||||
# Generate a randomized value upon each connect
|
||||
macAdress = "random";
|
||||
|
||||
# Enable Wi-Fi power saving
|
||||
powersave = true;
|
||||
|
||||
# Backend is either wpa_supplicant or iwd,
|
||||
# we use wpa_supplicant.
|
||||
backend = "wpa_supplicant";
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue