Skip to content

Commit

Permalink
refactor(system/svc/wiindowmanager): rework hyprland module
Browse files Browse the repository at this point in the history
  • Loading branch information
piyoki committed Sep 20, 2024
1 parent 314fba6 commit e9701ff
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 9 deletions.
13 changes: 8 additions & 5 deletions system/services/windowmanager/hyprland/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@
./hyprpaper.nix
./pyprland.nix
./xdg-portal.nix
./xwayland.nix
];

# enable hyprland
programs.hyprland = {
enable = true;
package = inputs.hyprland.packages.${system}.hyprland;
portalPackage = inputs.hyprland.packages.${system}.xdg-desktop-portal-hyprland;
programs = {
# enable hyprland
hyprland = {
enable = true;
package = inputs.hyprland.packages.${system}.hyprland;
portalPackage = inputs.hyprland.packages.${system}.xdg-desktop-portal-hyprland;
};
};
}
6 changes: 3 additions & 3 deletions system/services/windowmanager/hyprland/xdg-portal.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Reference:
# https://github.com/hyprwm/xdg-desktop-portal-hyprland
# https://nixos.wiki/wiki/Sway
# https://search.nixos.org/options?channel=unstable&show=xdg.portal

{ pkgs, inputs, system, ... }:

Expand All @@ -26,9 +27,8 @@ in
# enable hyprland's xdg-desktop-portal
xdg.portal = {
enable = true;
# hyprland has its own portal, wlr is not needed
wlr.enable = false;
configPackages = [ pkgs-hypr.xdg-desktop-portal-hyprland ];
# sets environment variable NIXOS_XDG_OPEN_USE_PORTAL to 1
xdgOpenUsePortal = true;
extraPortals = [
pkgs.xdg-desktop-portal-gtk
pkgs-hypr.xdg-desktop-portal-hyprland
Expand Down
9 changes: 9 additions & 0 deletions system/services/windowmanager/hyprland/xwayland.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Reference:
# https://stackoverflow.com/questions/77590918/not-able-to-share-entire-screen-on-discord-in-hyprland

_:

{
# enable xwayland
programs.xwayland.enable = true;
}
6 changes: 5 additions & 1 deletion system/services/xdg-portal.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Reference: https://nixos.wiki/wiki/Sway
# Reference:
# https://nixos.wiki/wiki/Sway
# https://search.nixos.org/options?channel=unstable&show=xdg.portal

{ pkgs, ... }:

Expand All @@ -20,6 +22,8 @@

xdg.portal = {
enable = true;
# sets environment variable NIXOS_XDG_OPEN_USE_PORTAL to 1
xdgOpenUsePortal = true;
# gtk portal needed to make gtk apps happy
extraPortals = [
pkgs.xdg-desktop-portal-gtk
Expand Down

0 comments on commit e9701ff

Please sign in to comment.