From 9c2386d19e7fdc95c9236e024d5d06dc10bc53eb Mon Sep 17 00:00:00 2001 From: EdenQwQ Date: Mon, 23 Mar 2026 23:02:16 +0800 Subject: [PATCH] fix screen flickering and keyboard not working --- home/lib/colorScheme/recolor.py | 2 +- home/lib/swhkd.nix | 2 +- home/programs/coding/nixvim/lsp.nix | 2 +- home/programs/desktop/mango/waybar.nix | 4 +- hosts/xiaomi/hardware-configuration.nix | 66 +++++++++++++++---------- hosts/xiaomi/os.nix | 10 +++- os/system/stylix.nix | 39 +++++++-------- 7 files changed, 74 insertions(+), 51 deletions(-) diff --git a/home/lib/colorScheme/recolor.py b/home/lib/colorScheme/recolor.py index 382093b..03fa6d9 100644 --- a/home/lib/colorScheme/recolor.py +++ b/home/lib/colorScheme/recolor.py @@ -393,7 +393,7 @@ def expand_all_hex(text: str) -> str: return re.sub( r"((? .needs-attention { -gtk-icon-effect: highlight; } - -''; + + ''; ".config/mango/waybar/animation.css".text = # css '' diff --git a/hosts/xiaomi/hardware-configuration.nix b/hosts/xiaomi/hardware-configuration.nix index 8d2ab92..5efc3a9 100644 --- a/hosts/xiaomi/hardware-configuration.nix +++ b/hosts/xiaomi/hardware-configuration.nix @@ -1,47 +1,63 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: +{ + config, + lib, + pkgs, + modulesPath, + ... +}: { - imports = - [ (modulesPath + "/hardware/cpu/intel-npu.nix") - (modulesPath + "/installer/scan/not-detected.nix") - ]; + imports = [ + (modulesPath + "/hardware/cpu/intel-npu.nix") + (modulesPath + "/installer/scan/not-detected.nix") + ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "usbhid" "sd_mod" ]; + boot.initrd.availableKernelModules = [ + "xhci_pci" + "thunderbolt" + "nvme" + "usb_storage" + "usbhid" + "sd_mod" + ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-intel" ]; boot.extraModulePackages = [ ]; - fileSystems."/" = - { device = "/dev/disk/by-uuid/f6ac48f0-6517-4c80-af9e-f81178d04f94"; - fsType = "btrfs"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/f6ac48f0-6517-4c80-af9e-f81178d04f94"; + fsType = "btrfs"; + }; - fileSystems."/nix" = - { device = "/dev/disk/by-uuid/f6ac48f0-6517-4c80-af9e-f81178d04f94"; - fsType = "btrfs"; - options = [ "subvol=nix" ]; - }; + fileSystems."/nix" = { + device = "/dev/disk/by-uuid/f6ac48f0-6517-4c80-af9e-f81178d04f94"; + fsType = "btrfs"; + options = [ "subvol=nix" ]; + }; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/D519-CFA4"; - fsType = "vfat"; - options = [ "fmask=0077" "dmask=0077" ]; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/D519-CFA4"; + fsType = "vfat"; + options = [ + "fmask=0077" + "dmask=0077" + ]; + }; - fileSystems."/home" = - { device = "/dev/disk/by-uuid/4360a1b0-918a-41d7-9bba-31da7e5974ff"; - fsType = "btrfs"; - }; + fileSystems."/home" = { + device = "/dev/disk/by-uuid/4360a1b0-918a-41d7-9bba-31da7e5974ff"; + fsType = "btrfs"; + }; swapDevices = [ { device = "/var/lib/swapfile"; size = 16 * 1024; } - ]; + ]; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.intel.npu.enable = true; diff --git a/hosts/xiaomi/os.nix b/hosts/xiaomi/os.nix index a59d7af..be2d9ec 100644 --- a/hosts/xiaomi/os.nix +++ b/hosts/xiaomi/os.nix @@ -1,6 +1,14 @@ -{ host, ... }: +{ host, pkgs, ... }: { imports = [ ./hardware-configuration.nix ]; system.stateVersion = "26.05"; networking.hostName = host; + boot.kernelParams = [ + "i8042.reset" + "i8042.nomux" + "i8042.nopnp" + "i8042.dumbkbd" + "xe.force_probe=*" + "xe.enable_psr=0" + ]; } diff --git a/os/system/stylix.nix b/os/system/stylix.nix index e14bda3..a5114d3 100644 --- a/os/system/stylix.nix +++ b/os/system/stylix.nix @@ -9,26 +9,25 @@ let cfg = self.homeConfigurations."${user}@${host}".config; in { - stylix = - { - enable = true; - autoEnable = false; - targets = { - console.enable = true; - gnome.enable = true; - grub.enable = true; - plymouth.enable = true; - }; - } - // ( - if builtins.hasAttr "base16Scheme" cfg.stylix then - { base16Scheme = lib.mkDefault cfg.stylix.base16Scheme; } - else - { } - ) - // ( - if builtins.hasAttr "image" cfg.stylix then { image = lib.mkDefault cfg.stylix.image; } else { } - ); + stylix = { + enable = true; + autoEnable = false; + targets = { + console.enable = true; + gnome.enable = true; + grub.enable = true; + plymouth.enable = true; + }; + } + // ( + if builtins.hasAttr "base16Scheme" cfg.stylix then + { base16Scheme = lib.mkDefault cfg.stylix.base16Scheme; } + else + { } + ) + // ( + if builtins.hasAttr "image" cfg.stylix then { image = lib.mkDefault cfg.stylix.image; } else { } + ); specialisation = builtins.mapAttrs (name: value: { configuration = { stylix =