From e8cab9c4869229dba226018135535ae5399d6221 Mon Sep 17 00:00:00 2001 From: Mohammad Rafiq Date: Thu, 27 Feb 2025 17:12:01 +0800 Subject: [PATCH] fix(hyprland): define hyprland in uwsm --- hosts/nemesis/default.nix | 16 +++++++++++++--- scripts/hyprland-tty-launch.nix | 5 ----- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/hosts/nemesis/default.nix b/hosts/nemesis/default.nix index 1c86910..16d466c 100644 --- a/hosts/nemesis/default.nix +++ b/hosts/nemesis/default.nix @@ -2,9 +2,9 @@ # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). -{ inputs, config, pkgs, ... }: - -{ +{ inputs, config, pkgs, ... }: let + hyprland-pkgs = inputs.hyprland.inputs.nixpkgs.legacyPackages.${pkgs.stdenv.hostPlatform.system}; +in { imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix @@ -18,6 +18,7 @@ # Graphics settings are defined here hardware = { graphics.enable = true; + graphics.package = hyprland-pkgs.mesa.drivers; graphics.extraPackages = with pkgs; [ nvidia-vaapi-driver ocl-icd @@ -121,6 +122,15 @@ services.openssh.enable = true; services.tailscale.enable = true; + programs.uwsm = { + enable = true; + waylandCompositors.hyprland = { + prettyName = "Hyprland"; + comment = "Hyprland compositor managed by UWSM"; + binPath = "/run/current-system/sw/bin/Hyprland"; + }; + }; + programs.hyprland = { enable = true; # Use the packages that we have defined as inputs in our flake. diff --git a/scripts/hyprland-tty-launch.nix b/scripts/hyprland-tty-launch.nix index 2f237e5..3448580 100644 --- a/scripts/hyprland-tty-launch.nix +++ b/scripts/hyprland-tty-launch.nix @@ -7,11 +7,6 @@ environment.etc."profile.d/hyprland-tty-launch.sh".text = '' #!/bin/$SHELL - # if uwsm check may-start && uwsm select; then - # exec systemd-cat -t uwsm_start uwsm start default - # fi - - # OR (to bypass the compositor selection menu): if uwsm check may-start; then exec uwsm start hyprland.desktop fi