From c557367aafbd8ad30f6e40403e71dd883f839357 Mon Sep 17 00:00:00 2001 From: matt1432 Date: Sat, 25 Nov 2023 03:24:12 -0500 Subject: [PATCH] feat(hyprland): use final package --- devices/binto/modules/desktop.nix | 15 ++++++++------- devices/binto/modules/nvidia.nix | 6 +++++- devices/wim/modules/desktop.nix | 13 +++++++------ flake.lock | Bin 23496 -> 23496 bytes home/hyprland/default.nix | 11 ++++++++++- modules/greetd/default.nix | 5 +++-- 6 files changed, 33 insertions(+), 17 deletions(-) diff --git a/devices/binto/modules/desktop.nix b/devices/binto/modules/desktop.nix index 5984a6ba..a6db0bf7 100644 --- a/devices/binto/modules/desktop.nix +++ b/devices/binto/modules/desktop.nix @@ -1,16 +1,17 @@ { pkgs, - hyprland, + config, ... -}: { +}: let + user = config.services.device-vars.username; + hyprland = config.home-manager.users.${user}.wayland.windowManager.hyprland.finalPackage; +in { programs.dconf.enable = true; services = { xserver = { displayManager = { - sessionPackages = [ - hyprland.packages.x86_64-linux.default - ]; + sessionPackages = [hyprland]; }; libinput.enable = true; @@ -19,8 +20,8 @@ greetd = { settings = { initial_session = { - command = "${hyprland.packages.x86_64-linux.default}/bin/Hyprland"; - user = "matt"; + command = "${hyprland}/bin/Hyprland"; + user = user; }; }; }; diff --git a/devices/binto/modules/nvidia.nix b/devices/binto/modules/nvidia.nix index 5681d63a..f893f0c7 100644 --- a/devices/binto/modules/nvidia.nix +++ b/devices/binto/modules/nvidia.nix @@ -1,9 +1,13 @@ -{config, ...}: { +{config, pkgs, ...}: { # Enable OpenGL hardware.opengl = { enable = true; driSupport = true; driSupport32Bit = true; + + extraPackages = with pkgs; [ + vaapiVdpau + ]; }; # Load nvidia driver for Xorg and Wayland diff --git a/devices/wim/modules/desktop.nix b/devices/wim/modules/desktop.nix index b7b9809a..b8a96f86 100644 --- a/devices/wim/modules/desktop.nix +++ b/devices/wim/modules/desktop.nix @@ -1,16 +1,17 @@ { - hyprland, pkgs, + config, ... -}: { +}: let + user = config.services.device-vars.username; + hyprland = config.home-manager.users.${user}.wayland.windowManager.hyprland.finalPackage; +in { programs.dconf.enable = true; services = { xserver = { displayManager = { - sessionPackages = [ - hyprland.packages.x86_64-linux.default - ]; + sessionPackages = [hyprland]; }; libinput.enable = true; @@ -20,7 +21,7 @@ greetd = { settings = { initial_session = { - command = "${hyprland.packages.x86_64-linux.default}/bin/Hyprland"; + command = "${hyprland}/bin/Hyprland"; user = "matt"; }; }; diff --git a/flake.lock b/flake.lock index 9a94a255cea73e53977c4b2af2043dc097c279b5..ef82603973e9032587e244ebed2c92ca0275fc02 100644 GIT binary patch delta 253 zcmX@Ho$_hLanaAZDoNAVAVw_@XW{_-bX>5>aXlZF?VQy%Y zY@Cu}Y+{^hX^>=KI@wXvd-4Ve#mN`!q$lgzYHvPcU&6%-RA^*Ad7_@Iwy{ZMqH%Fj zSde*+SAKd%PGx$QMOuJoZk1=2Nu*((pT3iJRjz(|SXRF4BvbRrdEWe!@3OFKSQ?pI w7$l__8Kjz|B^sC-nWdQ-ry3XX;clcm} zm!1hGf#~`$W1~5}v>&yS{n^?nZ#YzvCsb<=Iii3o?Ia8-L?bCN!Hgh5v~^ECyC|L5 z@9L2~yQ(a|YLnd}2aq`bdzOxGE~bqfB;sixhd~y)9hsW({aa(EFl?E&@ZX<1b@|BW vl-b^KW0~UU&Z&Cn`~7 diff --git a/home/hyprland/default.nix b/home/hyprland/default.nix index a4bc1ca7..feb44677 100644 --- a/home/hyprland/default.nix +++ b/home/hyprland/default.nix @@ -12,6 +12,15 @@ gset = pkgs.gsettings-desktop-schemas; polkit = pkgs.plasma5Packages.polkit-kde-agent; + + mainPkg = + if osConfig.hardware.nvidia.modesetting.enable + then { + hyprland = pkgs.hyprland; + } + else { + hyprland = hyprland.packages.x86_64-linux.default; + }; in { imports = [ ./theme.nix @@ -25,7 +34,7 @@ in { wayland.windowManager.hyprland = { enable = true; - package = hyprland.packages.x86_64-linux.default; + package = mainPkg.hyprland; enableNvidiaPatches = osConfig.hardware.nvidia.modesetting.enable; plugins = diff --git a/modules/greetd/default.nix b/modules/greetd/default.nix index 4a01d6e0..7fbce671 100644 --- a/modules/greetd/default.nix +++ b/modules/greetd/default.nix @@ -2,9 +2,11 @@ lib, pkgs, config, - hyprland, ... }: let + user = config.services.device-vars.username; + hyprBin = "${config.home-manager.users.${user}.wayland.windowManager.hyprland.finalPackage}/bin"; + nvidia = if config.hardware.nvidia.modesetting.enable then { @@ -20,7 +22,6 @@ env = ""; }; regreetBin = "${lib.getExe config.programs.regreet.package}"; - hyprBin = "${hyprland.packages.x86_64-linux.default}/bin"; gset = pkgs.gsettings-desktop-schemas; css = pkgs.writeText "style.css" ''${builtins.readFile ./style.css}'';