From 00b0c19345b620b2e42df5c3ef40def4a2796fff Mon Sep 17 00:00:00 2001 From: Natsu Kagami Date: Thu, 31 Aug 2023 00:52:47 +0200 Subject: [PATCH] Hardware support for yoga - Disable modem so we can do suspend - Enable and install rotation indicators --- home/nki-x1c1.nix | 24 ++++++++++++++++++++++-- nki-yoga-g8/hardware-configuration.nix | 7 +++++++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/home/nki-x1c1.nix b/home/nki-x1c1.nix index d9439a4..40f0af5 100644 --- a/home/nki-x1c1.nix +++ b/home/nki-x1c1.nix @@ -37,14 +37,34 @@ programs.my-sway.fontSize = 14.0; programs.my-sway.terminal = "${config.programs.kitty.package}/bin/kitty"; programs.my-sway.browser = "librewolf"; - # Keyboard support wayland.windowManager.sway.config = { + # Keyboard support input."*".xkb_layout = "jp"; input."1278:34:HHKB-Hybrid_3_Keyboard".xkb_layout = "jp"; input."1:1:AT_Translated_Set_2_keyboard" = { xkb_options = "ctrl:swapcaps"; - # xkb_layout = "us"; }; + + startup = [ + # rotation + ( + let + iio-sway = pkgs.stdenv.mkDerivation { + name = "iio-sway"; + version = "0.0.1"; + src = pkgs.fetchFromGitHub { + owner = "okeri"; + repo = "iio-sway"; + rev = "e07477d1b2478fede1446e97424a94c80767819d"; + hash = "sha256-JGacKajslCOvd/BFfFSf7s1/hgF6rJqJ6H6xNnsuMb4="; + }; + buildInputs = with pkgs; [ dbus ]; + nativeBuildInputs = with pkgs; [ meson ninja pkg-config ]; + }; + in + { command = "${iio-sway}/bin/iio-sway"; } + ) + ]; }; # input-remapping xdg.configFile."autostart/input-remapper-autoload.desktop".source = diff --git a/nki-yoga-g8/hardware-configuration.nix b/nki-yoga-g8/hardware-configuration.nix index f03c91a..aca434f 100644 --- a/nki-yoga-g8/hardware-configuration.nix +++ b/nki-yoga-g8/hardware-configuration.nix @@ -32,6 +32,13 @@ { device = "/var/swapfile"; size = 32 * 1024; } ]; + boot.blacklistedKernelModules = [ + # Disable modem because it locks up suspend + "mtk_t7xx" + ]; + + hardware.sensor.iio.enable = true; # Orientaion and ambient light sensors + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's # still possible to use this option, but it's recommended to use it in conjunction