adyya-flake/networking/general.mod.nix
Ittihadyya d713299ed8
Some checks failed
/ Check formatting (push) Has been cancelled
formatting and enable wol
2025-01-10 07:25:01 +02:00

254 lines
7.3 KiB
Nix

{
# networking? I sure hope it is. (It was not)
universal.modules = [
(
{
pkgs,
lib,
...
}: {
networking.networkmanager = {
enable = true;
plugins = lib.mkForce []; # networkmanager has a shit ton of vpn plugins by default. which we do not care about because we use wireguard. -e
};
systemd.services.NetworkManager-wait-online.enable = false; # # disable networkmanager's waitonline because it fucks up switches
networking.usePredictableInterfaceNames = false;
users.users.emv.extraGroups = ["networkmanager"];
environment.systemPackages = with pkgs; [
busybox
tcpdump
nmap
];
networking.nameservers = [
"10.24.1.9"
"9.9.9.9"
]; # first is pihole (on fructose currently, after we get kubernetes set up we should figure out how to do it in a better way) second is quad9
}
)
];
personal.modules = [
(
{pkgs, ...}: {
environment.systemPackages = with pkgs; [
toybox
];
programs.wireshark.enable = true;
users.users.emv.extraGroups = ["wireshark"];
}
)
];
aspartame.modules = [
{
networking = {
enableIPv6 = true;
defaultGateway6.address = "fe80::1";
defaultGateway6.interface = "ens18";
interfaces.ens18.ipv6.addresses = [
{
address = "2a02:c206:2217:6900::1";
prefixLength = 64;
}
];
};
}
];
glucose.modules = [
(
{...}: {
networking = {
interfaces.eth0.ipv4.addresses = [
{
address = "10.12.96.4";
prefixLength = 24;
}
];
defaultGateway = {
address = "10.12.96.1";
interface = "eth0";
};
};
}
)
];
fructose.modules = [
(
{...}: {
networking = {
interfaces.eth0.ipv4.addresses = [
{
address = "10.12.96.9";
prefixLength = 24;
}
];
defaultGateway = {
address = "10.12.96.1";
interface = "eth0";
};
};
}
)
];
capsaicin.modules = [
(
{config, ...}: {
networking.resolvconf.enable = false;
networking = {
interfaces.eth0 = {
wakeOnLan.enable = true;
ipv4.addresses = [
{
address = "192.168.88.225";
prefixLength = 24;
}
];
};
defaultGateway = {
address = "192.168.88.1";
interface = "eth0";
};
};
/*
networking.networkmanager = { # should probably figure out a way to get the default wireless interface? -e --- https://www.networkmanager.dev/docs/api/latest/nm-settings-nmcli.html Godsend
ensureProfiles = {
environmentFiles = [ "${config.sops.templates."networkmanager.env.secrets.yaml".path}" ];
profiles = {
home-wifi = {
connection = {
id = "home-wifi";
permissions = "";
type = "wifi";
interface-name = "wlp4s0";
};
ipv4 = {
method = "manual";
ignore-auto-dns = true;
addresses = "192.168.88.170/24, 10.12.96.226/24";
};
ipv6.method = "disabled";
wifi = {
mode = "infrastructure";
ssid = "$HOME1_SSID";
};
wifi-security = {
auth-alg = "open";
key-mgmt = "wpa-psk";
psk = "$HOME1_PSK";
};
};
home1eth = {
connection = {
id = "home1eth";
permissions = "";
type = "ethernet";
interface-name = "enp5s0";
};
ipv4 = {
method = "manual";
ignore-auto-dns = true;
addresses = "192.168.88.169/24, 10.12.96.225/24";
};
ipv6.method = "disabled";
ethernet = {
auto-negotiate = true;
mtu = "auto";
};
};
};
};
};
*/
# this doesn't work, for reasons unknown, so i'm commenting it out -e
}
)
];
menthol.modules = [
(
{config, ...}: {
hardware.bluetooth = {
enable = true; # menthol is the only computer that actually has a bluetooth module.
powerOnBoot = true; # this will kill the battery, beware.
};
networking.networkmanager = {
# should probably figure out a way to get the default wireless interface?
ensureProfiles = {
environmentFiles = ["${config.sops.templates."networkmanager.env.secrets.yaml".path}"];
profiles = {
home2wireless = {
connection = {
id = "home2";
permissions = "";
type = "wifi";
interface-name = "wlp4s0";
};
ipv4 = {
method = "auto";
ignore-auto-dns = true;
};
ipv6.method = "disabled";
wifi = {
mode = "infrastructure";
ssid = "$HOME2_SSID";
};
wifi-security = {
auth-alg = "open";
key-mgmt = "wpa-psk";
psk = "$HOME2_PSK";
};
};
home1wireless = {
# i don't know if ensureProfiles appends or overwrites so i'm doing this -e
connection = {
id = "home1wireless";
permissions = "";
type = "wifi";
interface-name = "wlp4s0";
};
ipv4 = {
method = "auto";
ignore-auto-dns = true;
};
ipv6.method = "disabled";
wifi = {
mode = "infrastructure";
ssid = "$HOME1_SSID";
};
wifi-security = {
auth-alg = "open";
key-mgmt = "wpa-psk";
psk = "$HOME1_PSK";
};
};
phonehotspot = {
connection = {
id = "phonehotspot";
permissions = "";
type = "wifi";
interface-name = "wlp4s0";
};
ipv4 = {
method = "auto";
ignore-auto-dns = true;
};
ipv6.method = "disabled";
wifi = {
mode = "infrastructure";
ssid = "$PHONE_HOTSPOT_SSID";
};
wifi-security = {
auth-alg = "open";
keu-mgmt = "wpa-psk";
psk = "$PHONE_HOTSPOT-PSK";
};
};
};
};
};
}
)
];
}