hyprland: cleanup, fix xdg portal

This commit is contained in:
Bloxx12 2025-04-09 15:31:18 +02:00
commit 0b78657f3b
2 changed files with 9 additions and 27 deletions

View file

@ -1,10 +1,8 @@
{
config,
lib,
pkgs,
...
}: let
cfg = config.modules.desktops.hyprland;
inherit (builtins) map genList toString;
inherit (lib.meta) getExe getExe';
in {
@ -49,10 +47,10 @@ in {
"$mainMod, V, togglespecialworkspace, audio"
# Reload hyprland
"$mainMod, R, exec, ${cfg.package}/bin/hyprctl reload"
"$mainMod, R, exec, ${getExe' pkgs.hyprland "hyprctl"} reload"
# Restart waybar
"$mainMod CONTROL, B, exec, ${pkgs.procps}/bin/pkill waybar || ${pkgs.waybar}/bin/waybar"
"$mainMod CONTROL, B, exec, ${pkgs.procps}/bin/pkill waybar || ${getExe pkgs.waybar}"
];
binde = [

View file

@ -5,11 +5,11 @@
pkgs,
...
}: let
cfg = config.modules.desktops.hyprland;
# inherit (inputs.hyprsplit.packages.${pkgs.system}) hyprsplit;
inherit (lib.modules) mkIf mkDefault;
inherit (lib.modules) mkIf;
inherit (lib.options) mkOption;
inherit (lib.types) bool enum package;
inherit (lib.types) bool;
cfg = config.modules.desktops.hyprland;
in {
imports = [
./binds.nix
@ -19,8 +19,6 @@ in {
./workspaces.nix
inputs.hyprland.nixosModules.default
];
# we disable the default hyprland module
# disabledModules = ["programs/hyprland.nix"];
options.modules.desktops.hyprland = {
enable = mkOption {
@ -30,19 +28,6 @@ in {
Whether to enable Hyprland wayland compositor.
'';
};
package = mkOption {
type = package;
default = pkgs.hyprland;
description = ''
The Hyprland package to be used.
'';
};
portalPackage = mkOption {
type = package;
default = pkgs.xdg-desktop-portal-hyprland;
description = "The hyprland portal package";
};
};
config = mkIf cfg.enable {
@ -59,15 +44,14 @@ in {
# xdg Portal
xdg.portal = {
enable = true;
configPackages = mkDefault [
pkgs.xdg-desktop-portal-hyprland
];
xdgOpenUsePortal = true;
extraPortals = [
pkgs.xdg-desktop-portal-gtk
pkgs.xdg-desktop-portal-hyprland
];
config = {
common.default = ["gtk" "hyprland"];
common.default = ["*"];
hyprland.default = ["gtk" "hyprland"];
};
};
};