mirror of
https://github.com/XNM1/linux-nixos-hyprland-config-dotfiles.git
synced 2025-09-15 09:45:58 +03:00
switched from networkmanager
to iwd
This commit is contained in:
@@ -7,13 +7,13 @@ function airplane_mode_toggle
|
|||||||
set -l bluetooth_status (cat $backup_file | grep -o 'bluetooth:\(on\|off\)$' | cut -d':' -f2)
|
set -l bluetooth_status (cat $backup_file | grep -o 'bluetooth:\(on\|off\)$' | cut -d':' -f2)
|
||||||
|
|
||||||
# Restore network states
|
# Restore network states
|
||||||
if test "$wifi_status" = "on"
|
if test "$wifi_status" = on
|
||||||
nmcli radio wifi on
|
rfkill unblock wifi
|
||||||
# else
|
# else
|
||||||
# nmcli radio wifi off
|
# rfkill block wifi
|
||||||
end
|
end
|
||||||
|
|
||||||
if test "$bluetooth_status" = "on"
|
if test "$bluetooth_status" = on
|
||||||
rfkill unblock bluetooth
|
rfkill unblock bluetooth
|
||||||
# else
|
# else
|
||||||
# rfkill block bluetooth
|
# rfkill block bluetooth
|
||||||
@@ -27,7 +27,7 @@ function airplane_mode_toggle
|
|||||||
echo "bluetooth:$(rfkill list bluetooth | grep -qi "Soft blocked: no" && echo "on" || echo "off")" >>$backup_file
|
echo "bluetooth:$(rfkill list bluetooth | grep -qi "Soft blocked: no" && echo "on" || echo "off")" >>$backup_file
|
||||||
# Add more lines to backup other network types if needed
|
# Add more lines to backup other network types if needed
|
||||||
|
|
||||||
nmcli radio wifi off
|
rfkill block wifi
|
||||||
rfkill block bluetooth
|
rfkill block bluetooth
|
||||||
end
|
end
|
||||||
end
|
end
|
@@ -1,11 +1,11 @@
|
|||||||
function wifi_toggle
|
function wifi_toggle
|
||||||
set wifi_status (nmcli radio wifi)
|
set wifi_status (rfkill list wifi | grep -i -o "Soft blocked: yes")
|
||||||
set backup_file ~/.cache/airplane_backup
|
set backup_file ~/.cache/airplane_backup
|
||||||
|
|
||||||
if [ "$wifi_status" = enabled ]
|
if [ -z "$wifi_status" ]
|
||||||
nmcli radio wifi off
|
rfkill block wifi
|
||||||
else
|
else
|
||||||
nmcli radio wifi on
|
rfkill unblock wifi
|
||||||
if test -e $backup_file
|
if test -e $backup_file
|
||||||
rm $backup_file
|
rm $backup_file
|
||||||
end
|
end
|
||||||
|
@@ -162,7 +162,7 @@
|
|||||||
// "tooltip-format-ethernet":"Interface: {ifname}\nIP: {ipaddr}\nGW: {gwaddr}\nNetmask: {netmask}\nCIDR: {cidr}\n\n<span color='#a6da95'>{bandwidthUpBits}</span>\t<span color='#ee99a0'>{bandwidthDownBits}</span>\t<span color='#c6a0f6'>{bandwidthTotalBits}</span>",
|
// "tooltip-format-ethernet":"Interface: {ifname}\nIP: {ipaddr}\nGW: {gwaddr}\nNetmask: {netmask}\nCIDR: {cidr}\n\n<span color='#a6da95'>{bandwidthUpBits}</span>\t<span color='#ee99a0'>{bandwidthDownBits}</span>\t<span color='#c6a0f6'>{bandwidthTotalBits}</span>",
|
||||||
"max-length": 35,
|
"max-length": 35,
|
||||||
"on-click": "fish -c wifi_toggle",
|
"on-click": "fish -c wifi_toggle",
|
||||||
"on-click-right": "wezterm start nmtui",
|
"on-click-right": "iwgtk",
|
||||||
},
|
},
|
||||||
|
|
||||||
"group/misc": {
|
"group/misc": {
|
||||||
|
@@ -3,16 +3,29 @@
|
|||||||
{
|
{
|
||||||
# Enable Encrypted DNS
|
# Enable Encrypted DNS
|
||||||
networking = {
|
networking = {
|
||||||
nameservers = [ "127.0.0.1" "::1" ];
|
nameservers = [ "127.0.0.1" "[::1]" ];
|
||||||
# If using dhcpcd:
|
# If using dhcpcd:
|
||||||
|
dhcpcd.enable = false; # disable, because enabled by default
|
||||||
dhcpcd.extraConfig = "nohook resolv.conf";
|
dhcpcd.extraConfig = "nohook resolv.conf";
|
||||||
|
|
||||||
# If using NetworkManager:
|
# If using NetworkManager:
|
||||||
networkmanager.dns = "none";
|
networkmanager.dns = "none";
|
||||||
|
|
||||||
|
# If using resolvconf:
|
||||||
|
resolvconf = {
|
||||||
|
enable = false; # FIXME remember to delete /etc/resolv.conf after applying this config
|
||||||
|
useLocalResolver = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# If using iwd:
|
||||||
|
wireless.iwd.settings.Network.NameResolvingService = "none";
|
||||||
};
|
};
|
||||||
|
|
||||||
services.dnscrypt-proxy2 = {
|
services.dnscrypt-proxy2 = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
|
listen_addresses = [ "127.0.0.1:53" "[::1]:53" ];
|
||||||
|
|
||||||
ipv6_servers = true;
|
ipv6_servers = true;
|
||||||
require_dnssec = true;
|
require_dnssec = true;
|
||||||
|
|
||||||
|
@@ -1,13 +1,34 @@
|
|||||||
{ ... }:
|
{ pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
# Enable networking
|
# Enable networking
|
||||||
networking.hostName = "isitreal-laptop"; # Define your hostname.
|
networking.hostName = "isitreal-laptop"; # Define your hostname.
|
||||||
# Pick only one of the below networking options.
|
# Pick only one of the below networking options.
|
||||||
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
||||||
networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
|
# networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
|
||||||
|
# networking.networkmanager.wifi.backend = "iwd";
|
||||||
|
|
||||||
|
networking.wireless.iwd = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
General = {
|
||||||
|
EnableNetworkConfiguration = true;
|
||||||
|
};
|
||||||
|
Network = {
|
||||||
|
EnableIPv6 = true;
|
||||||
|
};
|
||||||
|
Scan = {
|
||||||
|
DisablePeriodicScan = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
# Configure network proxy if necessary
|
# Configure network proxy if necessary
|
||||||
# networking.proxy.default = "http://user:password@proxy:port/";
|
# networking.proxy.default = "http://user:password@proxy:port/";
|
||||||
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
|
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
iwgtk
|
||||||
|
impala
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user