feat: laptop mode

This commit is contained in:
Youwen Wu 2025-07-17 06:12:35 -07:00
parent d939e9a7ee
commit 55b0db1127
Signed by: youwen
GPG key ID: 865658ED1FE61EC3
2 changed files with 51 additions and 25 deletions

View file

@ -1,5 +1,4 @@
# Edit this configuration file to define what should be installed on # 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). # and in the NixOS manual (accessible by running nixos-help).
{ {
config, config,
@ -67,22 +66,47 @@
time.timeZone = "America/Los_Angeles"; time.timeZone = "America/Los_Angeles";
# hardware.nvidia = { hardware.nvidia = {
# modesetting.enable = true; # modesetting.enable = true;
# powerManagement.enable = true; # powerManagement.enable = true;
# powerManagement.finegrained = false; # powerManagement.finegrained = false;
# nvidiaSettings = true; # nvidiaSettings = true;
# open = true; # open = true;
# # prime = { prime = {
# # amdgpuBusId = "PCI:4:0:0"; amdgpuBusId = "PCI:4:0:0";
# # nvidiaBusId = "PCI:1:0:0"; nvidiaBusId = "PCI:1:0:0";
# # # offload = { # offload = {
# # # enable = true; # enable = true;
# # # enableOffloadCmd = true; # enableOffloadCmd = true;
# # # }; # };
# # sync.enable = 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; hardware.graphics.enable = true;

View file

@ -7,20 +7,22 @@
home.stateVersion = "24.05"; home.stateVersion = "24.05";
wayland.windowManager.hyprland.settings.monitor = lib.mkForce [ wayland.windowManager.hyprland.settings.monitor = lib.mkForce [
# "eDP-1,2560x1440@165,0x0,1.6" "eDP-1,2560x1440@165,0x0,1.6"
"eDP-1, disable" # "eDP-1, disable"
"HDMI-A-1,2560x1440@144,0x0,1.0" # "HDMI-A-1,2560x1440@144,0x0,1.0"
]; ];
# since we are using this as a "desktop" of sorts, we have no need to save # 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 # 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 # this line to force hyprland to use the nvidia GPU only for rendering. can
# be removed if only using internal display # be removed if only using internal display
wayland.windowManager.hyprland.settings.env = [ # wayland.windowManager.hyprland.settings.env = [
"AQ_DRM_DEVICES,/dev/dri/card1:/dev/dri/card0" # "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";
} }