Fix dedicated GPU mode

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2024-06-20 12:59:23 +03:00
parent ea01ac7fe0
commit dbbb11b4e9
2 changed files with 27 additions and 11 deletions

View File

@@ -53,14 +53,30 @@
initrd.kernelModules = [ "amdgpu" ];
};
home-manager.sharedModules = lib.mkIf config.programs.hyprland.enable [{ wayland.windowManager.hyprland.settings = {
monitor = "eDP-1, 2560x1600@165, 0x0, 1.25";
device = [
{
name = "syna2ba6:00-06cb:ce44-touchpad";
natural_scroll = "true";
sensitivity = 0.5;
}
];
}; }];
home-manager.sharedModules = lib.mkIf config.programs.hyprland.enable [{
wayland.windowManager.hyprland.settings = {
monitor = "eDP-1, 2560x1600@165, 0x0, 1.25";
env = [ "WLR_DRM_DEVICES,$HOME/.config/hypr/card" ];
device = [
{
name = "syna2ba6:00-06cb:ce44-touchpad";
natural_scroll = "true";
sensitivity = 0.5;
}
];
};
programs.zsh.loginExtra = lib.mkBefore ''
AMD=/dev/dri/by-path/pci-0000:06:00.0-card
NVIDIA=/dev/dri/by-path/pci-0000:01:00.0-card
if [ -e $AMD ]; then
CARD=$AMD
else
CARD=$NVIDIA
fi
ln -sf $CARD $HOME/.config/hypr/card
'';
}];
}

View File

@@ -99,7 +99,7 @@
};
};
programs.zsh.loginExtra = ''
programs.zsh.loginExtra = lib.mkAfter ''
if [ -z "''${WAYLAND_DISPLAY}" ] && [ ! -z "''${XDG_VTNR}" ] && [ "''${XDG_VTNR}" -eq 1 ]; then
${pkgs.hyprland}/bin/hyprland &> /tmp/hyprland.log
fi