Enable graphics acceleration.

This commit is contained in:
Tom Alexander 2024-12-19 18:59:38 -05:00
parent e97c570bb2
commit df3528d62a
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
2 changed files with 41 additions and 33 deletions

View File

@ -1,5 +1,44 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let
sway-config = pkgs.writeTextFile {
name = "config";
text = ''
# Default config for sway
#
# Copy this to ~/.config/sway/config and edit it to your liking.
#
# Read `man 5 sway` for a complete reference.
### Variables
#
# Logo key. Use Mod1 for Alt.
set $mod Mod4
# set $mod Mod1
# Home row direction keys, like vim
set $left h
set $down j
set $up k
set $right l
# Your preferred terminal emulator
set $term ${pkgs.alacritty}/bin/alacritty
# Your preferred application launcher
# Note: it's recommended that you pass the final command to sway
# set $menu dmenu_path | dmenu | xargs swaymsg exec
set $menu ${pkgs.wofi}/bin/wofi --show drun --gtk-dark
# Do not show a title bar on windows
default_border pixel 2
bindsym $mod+grave exec $term
exec ${pkgs.alacritty}/bin/alacritty
include ~/.config/sway/config.d/*.conf
include /etc/sway/config.d/*
'';
};
in
{ {
imports = []; imports = [];
@ -7,6 +46,7 @@
alacritty alacritty
firefox firefox
]; ];
hardware.opengl.enable = true;
environment.sessionVariables = { environment.sessionVariables = {
WLR_RENDERER_ALLOW_SOFTWARE = "1"; WLR_RENDERER_ALLOW_SOFTWARE = "1";
@ -18,7 +58,7 @@
extraOptions = [ extraOptions = [
"--debug" "--debug"
"--config" "--config"
"${./files/config}" "${sway-config}"
"--unsupported-gpu" "--unsupported-gpu"
]; ];
}; };

View File

@ -1,32 +0,0 @@
# Default config for sway
#
# Copy this to ~/.config/sway/config and edit it to your liking.
#
# Read `man 5 sway` for a complete reference.
### Variables
#
# Logo key. Use Mod1 for Alt.
set $mod Mod4
# set $mod Mod1
# Home row direction keys, like vim
set $left h
set $down j
set $up k
set $right l
# Your preferred terminal emulator
set $term alacritty
# Your preferred application launcher
# Note: it's recommended that you pass the final command to sway
# set $menu dmenu_path | dmenu | xargs swaymsg exec
set $menu wofi --show drun --gtk-dark
# Do not show a title bar on windows
default_border pixel 2
bindsym $mod+grave exec $term
exec alacritty
include ~/.config/sway/config.d/*.conf
include /etc/sway/config.d/*