Compare commits
No commits in common. "8b7ae654942b5e70cd637247bed02cfad8dd5743" and "2b77681552f07ce405c5845001198e7801158c09" have entirely different histories.
8b7ae65494
...
2b77681552
|
@ -69,7 +69,51 @@ in {
|
||||||
inherit (pkgs.libsForQt5) okular;
|
inherit (pkgs.libsForQt5) okular;
|
||||||
};
|
};
|
||||||
|
|
||||||
networking.networkmanager.enable = true;
|
networking.networkmanager = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
dispatcherScripts = [
|
||||||
|
{
|
||||||
|
source = let
|
||||||
|
grep = "${pkgs.gnugrep}/bin/grep";
|
||||||
|
nmcli = "${pkgs.networkmanager}/bin/nmcli";
|
||||||
|
in
|
||||||
|
pkgs.writeShellScript "disable_wifi_on_ethernet" ''
|
||||||
|
export LC_ALL=C
|
||||||
|
date >> /tmp/disable_wifi_on_ethernet.log
|
||||||
|
echo START "$@" >> /tmp/disable_wifi_on_ethernet.log
|
||||||
|
|
||||||
|
beginswith() { case $2 in "$1"*) true;; *) false;; esac; }
|
||||||
|
|
||||||
|
is_ethernet_interface ()
|
||||||
|
{
|
||||||
|
local type="$(${nmcli} dev show "$1" | grep 'GENERAL\.TYPE:' | awk '{ print $2 }')"
|
||||||
|
test "$type" = "ethernet" || beginswith enp "$1"
|
||||||
|
}
|
||||||
|
|
||||||
|
hotspot_enabled ()
|
||||||
|
{
|
||||||
|
${nmcli} dev | ${grep} -q "hotspot"
|
||||||
|
}
|
||||||
|
|
||||||
|
if is_ethernet_interface "$1" && ! hotspot_enabled; then
|
||||||
|
echo "change in ethernet and not in hotspot mode" >> /tmp/disable_wifi_on_ethernet.log
|
||||||
|
if [ "$2" = "up" ]; then
|
||||||
|
echo "turning wifi off" >> /tmp/disable_wifi_on_ethernet.log
|
||||||
|
nmcli radio wifi off
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$2" = "down" ]; then
|
||||||
|
echo "turning wifi on" >> /tmp/disable_wifi_on_ethernet.log
|
||||||
|
nmcli radio wifi on
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
echo END "$@" >> /tmp/disable_wifi_on_ethernet.log
|
||||||
|
'';
|
||||||
|
type = "basic";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
programs.nm-applet.enable = true;
|
programs.nm-applet.enable = true;
|
||||||
programs.steam.enable = true;
|
programs.steam.enable = true;
|
||||||
|
|
||||||
|
|
|
@ -51,6 +51,7 @@
|
||||||
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
|
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
|
||||||
|
|
||||||
programs = {
|
programs = {
|
||||||
|
dconf.enable = true;
|
||||||
light.enable = true;
|
light.enable = true;
|
||||||
};
|
};
|
||||||
services = {
|
services = {
|
||||||
|
|
Loading…
Reference in a new issue