tmp
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
let
|
||||
configLimit = 5;
|
||||
default = "@saved";
|
||||
kernel = pkgs.linuxPackages_latest;
|
||||
kernel = pkgs.unstable.linuxPackages_latest;
|
||||
in
|
||||
{
|
||||
# Configure bootloader with lanzaboot and secureboot
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
{
|
||||
config,
|
||||
# outputs,
|
||||
outputs,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
@@ -27,8 +27,80 @@ let
|
||||
fi
|
||||
'';
|
||||
fixWifiScript = pkgs.writeScriptBin "fix-wifi" ''
|
||||
/home/matt/nix-config/scripts/fix-wifi.py
|
||||
'';
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import subprocess
|
||||
import socket
|
||||
import logging
|
||||
from typing import List, Optional
|
||||
|
||||
def check_internet_connection(hosts_to_check: Optional[List[str]] = None) -> bool:
|
||||
"""
|
||||
Check internet connectivity by attempting to connect to reliable hosts.
|
||||
|
||||
:param hosts_to_check: Optional list of hosts to check.
|
||||
:return: Boolean indicating if internet connection is available
|
||||
"""
|
||||
if hosts_to_check is None:
|
||||
hosts_to_check = [
|
||||
"8.8.8.8", # Google DNS
|
||||
"1.1.1.1", # Cloudflare DNS
|
||||
"9.9.9.9" # Quad9 DNS
|
||||
]
|
||||
|
||||
for host in hosts_to_check:
|
||||
try:
|
||||
# Create a socket connection with a 5-second timeout
|
||||
socket.create_connection((host, 53), timeout=5)
|
||||
return True
|
||||
except (socket.error, socket.timeout):
|
||||
continue
|
||||
|
||||
return False
|
||||
|
||||
def reset_wifi_card() -> bool:
|
||||
"""
|
||||
Execute WiFi card reset commands.
|
||||
|
||||
:return: Boolean indicating if reset commands were successful
|
||||
"""
|
||||
reset_commands = [
|
||||
"echo 1 | sudo -u root tee /sys/bus/pci/devices/0000:09:00.0/reset",
|
||||
"sudo rmmod iwlwifi",
|
||||
"sudo modprobe iwlwifi"
|
||||
]
|
||||
|
||||
try:
|
||||
for command in reset_commands:
|
||||
result = subprocess.run(
|
||||
command,
|
||||
shell=True,
|
||||
check=True,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
text=True
|
||||
)
|
||||
print(f"Executed: {command}")
|
||||
print(f"Output: {result.stdout}")
|
||||
return True
|
||||
except subprocess.CalledProcessError as e:
|
||||
print(f"Error resetting WiFi: {e}")
|
||||
print(f"Error output: {e.stderr}")
|
||||
return False
|
||||
|
||||
def main():
|
||||
"""
|
||||
Check internet connection and reset WiFi if not connected.
|
||||
"""
|
||||
if not check_internet_connection():
|
||||
print("No internet connection detected. Attempting WiFi reset...")
|
||||
reset_wifi_card()
|
||||
else:
|
||||
print("Internet connection is stable. No reset needed.")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
'';
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
@@ -211,7 +283,9 @@ in
|
||||
kdePackages.ksvg
|
||||
lact
|
||||
memtest86-efi
|
||||
memtest86plus
|
||||
memtest86plus
|
||||
unstable.mesa
|
||||
unstable.driversi686Linux.mesa
|
||||
nano
|
||||
onlyoffice-bin
|
||||
os-prober
|
||||
@@ -270,9 +344,12 @@ in
|
||||
};
|
||||
|
||||
# Configure nixpkgs
|
||||
nixpkgs.config.permittedInsecurePackages = [
|
||||
# ...
|
||||
];
|
||||
nixpkgs = {
|
||||
overlays = [ outputs.overlays.nixpkgs-unstable ];
|
||||
config.permittedInsecurePackages = [
|
||||
# ...
|
||||
];
|
||||
};
|
||||
|
||||
# Define a user account. Don't forget to set a password with ‘passwd’.
|
||||
users.users."${user}" = {
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
displayManager.defaultSession = "gnome";
|
||||
|
||||
# Enable Flatpak
|
||||
flatpak.enable = true;
|
||||
flatpak.enable = false;
|
||||
|
||||
# disable plasma
|
||||
displayManager.sddm.enable = false;
|
||||
@@ -28,9 +28,10 @@
|
||||
environment = {
|
||||
systemPackages = with pkgs; [
|
||||
colloid-gtk-theme
|
||||
gnome-tweaks
|
||||
unstable.gnome-tweaks
|
||||
gnomeExtensions.appindicator
|
||||
gnomeExtensions.arcmenu
|
||||
gnomeExtensions.dash-to-dock
|
||||
gnomeExtensions.dash-to-panel
|
||||
gnomeExtensions.tiling-assistant
|
||||
];
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
"org/gnome/desktop/interface".font-antialiasing = "grayscale";
|
||||
"org/gnome/desktop/interface".font-hinting = "slight";
|
||||
"org/gnome/desktop/interface".gtk-theme = lib.mkDefault "Colloid-Dark";
|
||||
"org/gnome/desktop/interface".icon-theme = lib.mkDefault "Colloid-Dark";
|
||||
"org/gnome/desktop/interface".icon-theme = lib.mkDefault "Colloid-dark";
|
||||
"org/gnome/desktop/peripherals/mouse".accel-profile = "flat";
|
||||
"org/gnome/desktop/peripherals/touchpad".two-finger-scrolling-enabled = true;
|
||||
"org/gnome/desktop/peripherals/touchpad".tap-to-click = true;
|
||||
@@ -22,8 +22,8 @@
|
||||
"appindicatorsupport@rgcjonas.gmail.com"
|
||||
"arcmenu@arcmenu.com"
|
||||
"user-theme@gnome-shell-extensions.gcampax.github.com"
|
||||
"dash-to-panel@jderose9.github.com"
|
||||
"tiling-assistant@leleat-on-github"
|
||||
"dash-to-dock@micxgx.gmail.com"
|
||||
];
|
||||
"org/gnome/shell/extensions/dash-to-panel".primary-monitor = 1;
|
||||
"org/gnome/shell/extensions/dash-to-panel".multi-monitors = false;
|
||||
|
||||
@@ -58,23 +58,21 @@ in
|
||||
programs.command-not-found.enable = true;
|
||||
|
||||
home.packages = with pkgs; [
|
||||
# gamescope # using chaotic git version
|
||||
# gamescope-wsi # using chaotic git version
|
||||
age
|
||||
apple-cursor
|
||||
bottles
|
||||
chromium
|
||||
colloid-icon-theme
|
||||
colloid-kde
|
||||
compose2nix
|
||||
unstable.compose2nix
|
||||
coolercontrol.coolercontrol-gui
|
||||
deadnix
|
||||
discord
|
||||
fastfetch
|
||||
firefox
|
||||
freerdp
|
||||
gamescope_git
|
||||
gamescope-wsi_git
|
||||
gamescope
|
||||
gamescope-wsi
|
||||
goverlay
|
||||
heroic
|
||||
home-manager
|
||||
|
||||
@@ -11,7 +11,7 @@ let
|
||||
in
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
adwaita-icon-theme
|
||||
unstable.adwaita-icon-theme
|
||||
apple-cursor
|
||||
catppuccin-sddm
|
||||
colloid-gtk-theme
|
||||
@@ -19,19 +19,19 @@ in
|
||||
ddcutil
|
||||
dunst
|
||||
egl-wayland
|
||||
file-roller
|
||||
unstable.file-roller
|
||||
glib
|
||||
gnome-tweaks
|
||||
gnome-disk-utility
|
||||
gnome-system-monitor
|
||||
gsettings-desktop-schemas
|
||||
unstable.gnome-tweaks
|
||||
unstable.gnome-disk-utility
|
||||
unstable.gnome-system-monitor
|
||||
unstable.gsettings-desktop-schemas
|
||||
hyprcursor
|
||||
hyprland
|
||||
hyprshot
|
||||
libnotify
|
||||
mako
|
||||
meson
|
||||
nautilus
|
||||
unstable.nautilus
|
||||
networkmanagerapplet
|
||||
nm-tray
|
||||
nwg-drawer
|
||||
|
||||
Reference in New Issue
Block a user