mirror of
https://git.sr.ht/~azikx/wyswort
synced 2024-10-30 17:16:20 +00:00
41 lines
866 B
Nix
41 lines
866 B
Nix
{ lib, config, ... }:
|
|
|
|
with lib;
|
|
|
|
let cfg = config.module.hardware.network;
|
|
in {
|
|
options = {
|
|
module.hardware.network = {
|
|
enable = mkEnableOption "";
|
|
host = mkOption {
|
|
type = types.str;
|
|
default = null;
|
|
};
|
|
};
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
networking = { # FOR NETWORK
|
|
hostName = cfg.host;
|
|
networkmanager = {
|
|
enable = true;
|
|
insertNameservers = [ "1.1.1.1" "1.0.0.1" ];
|
|
dns = "systemd-resolved";
|
|
wifi = {
|
|
powersave = true;
|
|
macAddress = "random";
|
|
backend = "iwd";
|
|
};
|
|
};
|
|
useDHCP = mkDefault true;
|
|
nftables.enable = true;
|
|
};
|
|
services.resolved.enable = true;
|
|
systemd.services = { # IDK
|
|
NetworkManager-wait-online.enable = false;
|
|
systemd-networkd-wait-online.enable = mkForce false;
|
|
};
|
|
};
|
|
}
|
|
|