From 55b0db1127151993279b7c070b041cc03a5fd91e Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Thu, 17 Jul 2025 06:12:35 -0700 Subject: [PATCH] feat: laptop mode --- reference/hosts/adrastea/configuration.nix | 58 +++++++++++++++------- reference/hosts/adrastea/home.nix | 18 ++++--- 2 files changed, 51 insertions(+), 25 deletions(-) diff --git a/reference/hosts/adrastea/configuration.nix b/reference/hosts/adrastea/configuration.nix index b38422d..6beac24 100755 --- a/reference/hosts/adrastea/configuration.nix +++ b/reference/hosts/adrastea/configuration.nix @@ -1,5 +1,4 @@ # Edit this configuration file to define what should be installed on -# your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). { config, @@ -67,22 +66,47 @@ time.timeZone = "America/Los_Angeles"; - # hardware.nvidia = { - # modesetting.enable = true; - # powerManagement.enable = true; - # powerManagement.finegrained = false; - # nvidiaSettings = true; - # open = true; - # # prime = { - # # amdgpuBusId = "PCI:4:0:0"; - # # nvidiaBusId = "PCI:1:0:0"; - # # # offload = { - # # # enable = true; - # # # enableOffloadCmd = true; - # # # }; - # # sync.enable = true; - # # }; - # }; + hardware.nvidia = { + # modesetting.enable = true; + # powerManagement.enable = true; + # powerManagement.finegrained = false; + # nvidiaSettings = true; + # open = true; + prime = { + amdgpuBusId = "PCI:4:0:0"; + nvidiaBusId = "PCI:1:0:0"; + # offload = { + # enable = true; + # enableOffloadCmd = true; + # }; + sync.enable = true; + }; + }; + + services.keyd = { + enable = true; + keyboards = { + default = { + ids = [ "*" ]; + settings = { + main = { + capslock = "esc"; + leftmeta = "leftcontrol"; + leftalt = "leftmeta"; + leftcontrol = "leftalt"; + rightmeta = "leftalt"; + rightalt = "layer(rightalt)"; + }; + rightalt = { + h = "left"; + j = "down"; + k = "up"; + l = "right"; + }; + }; + }; + }; + }; hardware.graphics.enable = true; diff --git a/reference/hosts/adrastea/home.nix b/reference/hosts/adrastea/home.nix index 4bb0337..93e3608 100644 --- a/reference/hosts/adrastea/home.nix +++ b/reference/hosts/adrastea/home.nix @@ -7,20 +7,22 @@ home.stateVersion = "24.05"; wayland.windowManager.hyprland.settings.monitor = lib.mkForce [ - # "eDP-1,2560x1440@165,0x0,1.6" - "eDP-1, disable" - "HDMI-A-1,2560x1440@144,0x0,1.0" + "eDP-1,2560x1440@165,0x0,1.6" + # "eDP-1, disable" + # "HDMI-A-1,2560x1440@144,0x0,1.0" ]; # since we are using this as a "desktop" of sorts, we have no need to save # power by using optimus. poor performance on external display, so we add # this line to force hyprland to use the nvidia GPU only for rendering. can # be removed if only using internal display - wayland.windowManager.hyprland.settings.env = [ - "AQ_DRM_DEVICES,/dev/dri/card1:/dev/dri/card0" - ]; + # wayland.windowManager.hyprland.settings.env = [ + # "AQ_DRM_DEVICES,/dev/dri/card1:/dev/dri/card0" + # ]; - programs.waybar.settings.mainBar.output = "HDMI-A-1"; + # programs.waybar.settings.mainBar.output = "HDMI-A-1"; + programs.waybar.settings.mainBar.output = "eDP-1"; - liminalOS.desktop.hyprland.screenlocker.monitor = "HDMI-A-1"; + # liminalOS.desktop.hyprland.screenlocker.monitor = "HDMI-A-1"; + liminalOS.desktop.hyprland.screenlocker.monitor = "eDP-1"; }