fix(sway): add --unsupported-gpu conditionally

Sway refuses to run with nvidia drivers loaded.
This commit is contained in:
514fpv 2024-01-16 17:30:12 +08:00
parent 3e32d04460
commit a074a5a652
Signed by: koishi
SSH key fingerprint: SHA256:axz0uIzzY+5W19i7QOUuiw5LSqhKfCBKPf3L4xFRxLw

View file

@ -3,6 +3,7 @@
, config
, ... }: with lib; let
gui = with config.global.gui; ( enable && session );
nvidia = with config.global.gui; ( type == "nvidia" || type == "prime" );
in mkIf gui {
services.xserver.displayManager.sessionPackages = [
(pkgs.writeTextFile {
@ -21,7 +22,7 @@ in mkIf gui {
for profile in ''${(z)NIX_PROFILES}; do
fpath+=($profile/share/zsh/site-functions $profile/share/zsh/$ZSH_VERSION/functions $profile/share/zsh/vendor-completions)
done
exec sway --unsupported-gpu
exec sway ${if nvidia then "--unsupported-gpu" else ""}
'';
checkPhase = ''
${pkgs.stdenv.shellDryRun} "$target"