nix-configs/modules/desktop/networking.nix

91 lines
2.2 KiB
Nix
Raw Normal View History

2023-02-13 12:54:21 +01:00
{ config, lib, pkgs, ... }:
2023-10-28 22:25:06 +02:00
let
addNuShebang = path: builtins.concatStringsSep "\n\n" [
"#!${pkgs.nushellFull}/bin/nu"
(builtins.readFile path)
];
in {
2023-02-13 12:54:21 +01:00
config = {
networking = {
2023-10-28 22:25:06 +02:00
networkmanager = {
wifi.backend = "wpa_supplicant";
dispatcherScripts = [
{
type = "basic";
source = pkgs.writeText "dispatcher" (addNuShebang ../../other/scripts/dispatcher.nu);
}
];
};
hosts = {
"127.0.0.1" = [
"www.tiktok.com"
"www.twitter.com"
"www.instagram.com"
"www.facebook.com"
"www.snapchat.com"
2023-02-13 12:54:21 +01:00
2023-10-28 22:25:06 +02:00
"tiktok.com"
"twitter.com"
"instagram.com"
"facebook.com"
"snapchat.com"
2023-02-13 12:54:21 +01:00
2023-10-28 22:25:06 +02:00
"google-analytics.com"
"stats.g.doubleclick.net"
"googleadservices.com"
"googletagmanager.com"
"googletagservices.com"
"googlesyndication.com"
];
"10.31.208.9" = [
"mqtt.z9"
];
2023-11-07 08:05:47 +01:00
"10.31.208.10" = [
"club-assistant.ccchh.net"
];
"10.31.208.23" = [
"light.z9"
"light.ccchh.net"
];
"10.31.210.31" = [
"octopi.z9.ccchh.net"
];
"10.31.210.33" = [
"wled-kueche.z9.ccchh.net"
];
"10.31.210.34" = [
"wled-serverschrank.z9.ccchh.net"
];
"10.31.208.25" = [
"zigbee2mqtt.ccchh.net"
];
"10.31.208.24" = [
"esphome.ccchh.net"
];
2023-10-28 22:25:06 +02:00
};
2023-02-13 12:54:21 +01:00
};
2023-10-28 22:25:06 +02:00
environment.etc = (with builtins; (
listToAttrs (
map (v: {
name = "networkhooks/${v}";
value = {
text = addNuShebang ../../other/scripts/networkhooks/${v};
mode = "0755";
};
})
(attrNames (readDir ../../other/scripts/networkhooks))
)
));
2023-02-13 12:54:21 +01:00
systemd.services."NetworkManager-wait-online".enable = false;
services.mullvad-vpn.enable = true;
home-manager.users.jade = { pkgs, ... }: {
home.packages = with pkgs; [
networkmanagerapplet
mullvad-vpn
speedtest-cli
];
};
};
}