rewrite networking modules
This commit is contained in:
parent
49298541e5
commit
0bbb0aa204
11 changed files with 69 additions and 71 deletions
|
@ -3,8 +3,8 @@
|
||||||
./shell
|
./shell
|
||||||
./desktop
|
./desktop
|
||||||
./hardware
|
./hardware
|
||||||
./firewall.nix
|
|
||||||
./de
|
./de
|
||||||
|
./net
|
||||||
./input
|
./input
|
||||||
./media
|
./media
|
||||||
./graphics.nix
|
./graphics.nix
|
||||||
|
|
|
@ -9,7 +9,6 @@ with lib; {
|
||||||
./gaming.nix
|
./gaming.nix
|
||||||
./syncthing.nix
|
./syncthing.nix
|
||||||
./kdeconnect.nix
|
./kdeconnect.nix
|
||||||
./networking.nix
|
|
||||||
./social.nix
|
./social.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -1,69 +0,0 @@
|
||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
addNuShebang = path:
|
|
||||||
builtins.concatStringsSep "\n\n" [
|
|
||||||
"#!${pkgs.nushell}/bin/nu"
|
|
||||||
(builtins.readFile path)
|
|
||||||
];
|
|
||||||
in {
|
|
||||||
config = {
|
|
||||||
networking = {
|
|
||||||
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"
|
|
||||||
|
|
||||||
"tiktok.com"
|
|
||||||
"twitter.com"
|
|
||||||
"instagram.com"
|
|
||||||
"facebook.com"
|
|
||||||
"snapchat.com"
|
|
||||||
|
|
||||||
"google-analytics.com"
|
|
||||||
"stats.g.doubleclick.net"
|
|
||||||
"googleadservices.com"
|
|
||||||
"googletagmanager.com"
|
|
||||||
"googletagservices.com"
|
|
||||||
"googlesyndication.com"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
environment.etc = with builtins; (
|
|
||||||
listToAttrs (
|
|
||||||
map (v: {
|
|
||||||
name = "networkhooks/${v}";
|
|
||||||
value = {
|
|
||||||
text = addNuShebang ../../other/scripts/networkhooks/${v};
|
|
||||||
mode = "0755";
|
|
||||||
};
|
|
||||||
})
|
|
||||||
(attrNames (readDir ../../other/scripts/networkhooks))
|
|
||||||
)
|
|
||||||
);
|
|
||||||
systemd.services."NetworkManager-wait-online".enable = false;
|
|
||||||
services.mullvad-vpn.enable = true;
|
|
||||||
home-manager.users.jade = {pkgs, ...}: {
|
|
||||||
home.packages = with pkgs; [
|
|
||||||
networkmanagerapplet
|
|
||||||
mullvad-vpn
|
|
||||||
macchanger
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
17
modules/net/default.nix
Normal file
17
modules/net/default.nix
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
{...}: {
|
||||||
|
imports = [
|
||||||
|
./firewall.nix
|
||||||
|
./hosts.nix
|
||||||
|
./dispatchers
|
||||||
|
];
|
||||||
|
networking.networkmanager.wifi.backend = "wpa_supplicant";
|
||||||
|
systemd.services."NetworkManager-wait-online".enable = false;
|
||||||
|
services.mullvad-vpn.enable = true;
|
||||||
|
home-manager.users.jade = {pkgs, ...}: {
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
networkmanagerapplet
|
||||||
|
mullvad-vpn
|
||||||
|
macchanger
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
27
modules/net/dispatchers/default.nix
Normal file
27
modules/net/dispatchers/default.nix
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
{pkgs, ...}: let
|
||||||
|
addNuShebang = path:
|
||||||
|
builtins.concatStringsSep "\n\n" [
|
||||||
|
"#!${pkgs.nushell}/bin/nu"
|
||||||
|
(builtins.readFile path)
|
||||||
|
];
|
||||||
|
in {
|
||||||
|
networking.networkmanager.dispatcherScripts = [
|
||||||
|
{
|
||||||
|
type = "basic";
|
||||||
|
source = pkgs.writeText "dispatcher" (addNuShebang ./dispatcher.nu);
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
environment.etc = with builtins; (
|
||||||
|
listToAttrs (
|
||||||
|
map (v: {
|
||||||
|
name = "networkhooks/${v}";
|
||||||
|
value = {
|
||||||
|
text = addNuShebang ./hooks/${v};
|
||||||
|
mode = "0755";
|
||||||
|
};
|
||||||
|
})
|
||||||
|
(attrNames (readDir ./hooks))
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
24
modules/net/hosts.nix
Normal file
24
modules/net/hosts.nix
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
{...}: {
|
||||||
|
networking.hosts = {
|
||||||
|
"127.0.0.1" = [
|
||||||
|
"www.tiktok.com"
|
||||||
|
"www.twitter.com"
|
||||||
|
"www.instagram.com"
|
||||||
|
"www.facebook.com"
|
||||||
|
"www.snapchat.com"
|
||||||
|
|
||||||
|
"tiktok.com"
|
||||||
|
"twitter.com"
|
||||||
|
"instagram.com"
|
||||||
|
"facebook.com"
|
||||||
|
"snapchat.com"
|
||||||
|
|
||||||
|
"google-analytics.com"
|
||||||
|
"stats.g.doubleclick.net"
|
||||||
|
"googleadservices.com"
|
||||||
|
"googletagmanager.com"
|
||||||
|
"googletagservices.com"
|
||||||
|
"googlesyndication.com"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue