mirror of
https://github.com/nix-community/home-manager.git
synced 2025-12-14 21:11:08 +01:00
hyprland: fix null package conditions
This commit is contained in:
parent
e3baf274f4
commit
fee01c9351
1 changed files with 21 additions and 8 deletions
|
|
@ -62,12 +62,17 @@ in {
|
||||||
"Set this to null if you use the NixOS module to install Hyprland.";
|
"Set this to null if you use the NixOS module to install Hyprland.";
|
||||||
};
|
};
|
||||||
|
|
||||||
portalPackage = lib.mkPackageOption pkgs "xdg-desktop-portal-hyprland" { };
|
portalPackage = lib.mkPackageOption pkgs "xdg-desktop-portal-hyprland" {
|
||||||
|
nullable = true;
|
||||||
|
};
|
||||||
|
|
||||||
finalPackage = lib.mkOption {
|
finalPackage = lib.mkOption {
|
||||||
type = lib.types.package;
|
type = with lib.types; nullOr package;
|
||||||
readOnly = true;
|
readOnly = true;
|
||||||
default = cfg.package.override { enableXWayland = cfg.xwayland.enable; };
|
default = if cfg.package != null then
|
||||||
|
cfg.package.override { enableXWayland = cfg.xwayland.enable; }
|
||||||
|
else
|
||||||
|
null;
|
||||||
defaultText = lib.literalMD
|
defaultText = lib.literalMD
|
||||||
"`wayland.windowManager.hyprland.package` with applied configuration";
|
"`wayland.windowManager.hyprland.package` with applied configuration";
|
||||||
description = ''
|
description = ''
|
||||||
|
|
@ -76,9 +81,15 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
finalPortalPackage = lib.mkOption {
|
finalPortalPackage = lib.mkOption {
|
||||||
type = lib.types.package;
|
type = with lib.types; nullOr package;
|
||||||
readOnly = true;
|
readOnly = true;
|
||||||
default = cfg.portalPackage.override { hyprland = cfg.finalPackage; };
|
default = if (cfg.portalPackage != null) then
|
||||||
|
if cfg.finalPackage != null then
|
||||||
|
cfg.portalPackage.override { hyprland = cfg.finalPackage; }
|
||||||
|
else
|
||||||
|
cfg.portalPackage
|
||||||
|
else
|
||||||
|
null;
|
||||||
defaultText = lib.literalMD ''
|
defaultText = lib.literalMD ''
|
||||||
`wayland.windowManager.hyprland.portalPackage` with
|
`wayland.windowManager.hyprland.portalPackage` with
|
||||||
`wayland.windowManager.hyprland.finalPackage` override'';
|
`wayland.windowManager.hyprland.finalPackage` override'';
|
||||||
|
|
@ -281,9 +292,11 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
xdg.portal = {
|
xdg.portal = {
|
||||||
enable = true;
|
enable = cfg.finalPortalPackage != null;
|
||||||
extraPortals = [ cfg.finalPortalPackage ];
|
extraPortals =
|
||||||
configPackages = lib.mkDefault [ cfg.finalPackage ];
|
lib.mkIf (cfg.finalPortalPackage != null) [ cfg.finalPortalPackage ];
|
||||||
|
configPackages = lib.mkIf (cfg.finalPackage != null)
|
||||||
|
(lib.mkDefault [ cfg.finalPackage ]);
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.user.targets.hyprland-session = lib.mkIf cfg.systemd.enable {
|
systemd.user.targets.hyprland-session = lib.mkIf cfg.systemd.enable {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue