7 cfg = config.programs.hyprland;
9 finalPortalPackage = cfg.portalPackage.override {
10 hyprland = cfg.finalPackage;
14 options.programs.hyprland = {
15 enable = mkEnableOption null // {
16 description = mdDoc ''
17 Hyprland, the dynamic tiling Wayland compositor that doesn't sacrifice on its looks.
19 You can manually launch Hyprland by executing {command}`Hyprland` on a TTY.
21 A configuration file will be generated in {file}`~/.config/hypr/hyprland.conf`.
22 See <https://wiki.hyprland.org> for more information.
26 package = mkPackageOptionMD pkgs "hyprland" { };
28 finalPackage = mkOption {
31 default = cfg.package.override {
32 enableXWayland = cfg.xwayland.enable;
33 enableNvidiaPatches = cfg.enableNvidiaPatches;
35 defaultText = literalExpression
36 "`programs.hyprland.package` with applied configuration";
37 description = mdDoc ''
38 The Hyprland package after applying configuration.
42 portalPackage = mkPackageOptionMD pkgs "xdg-desktop-portal-hyprland" { };
44 xwayland.enable = mkEnableOption (mdDoc "XWayland") // { default = true; };
46 enableNvidiaPatches = mkEnableOption (mdDoc "patching wlroots for better Nvidia support");
49 config = mkIf cfg.enable {
50 environment.systemPackages = [ cfg.finalPackage ];
52 fonts.enableDefaultPackages = mkDefault true;
53 hardware.opengl.enable = mkDefault true;
56 dconf.enable = mkDefault true;
57 xwayland.enable = mkDefault cfg.xwayland.enable;
60 security.polkit.enable = true;
62 services.xserver.displayManager.sessionPackages = [ cfg.finalPackage ];
65 enable = mkDefault true;
66 extraPortals = [ finalPortalPackage ];
71 (mkRemovedOptionModule
72 [ "programs" "hyprland" "xwayland" "hidpi" ]
73 "XWayland patches are deprecated. Refer to https://wiki.hyprland.org/Configuring/XWayland"
75 (mkRenamedOptionModule
76 [ "programs" "hyprland" "nvidiaPatches" ]
77 [ "programs" "hyprland" "enableNvidiaPatches" ]