Files
dev/configs/nixos/modules/desktop/session/hyprland/default.nix

60 lines
1.5 KiB
Nix

{
config,
lib,
...
}:
# The Hyprland compositor.
let
cfg = config.modules.desktop.session.hyprland; # NOLINT(let_order)
user = config.user.name;
in
{
options.modules.desktop.session.hyprland = {
enable = lib.mkEnableOption "the Hyprland compositor";
blur = lib.mkEnableOption ''
window blur. Off by default as the single biggest battery cost on a
laptop, left on for a host with the headroom to spend it'';
};
config = lib.mkIf cfg.enable {
# This program integration owns the session, portals, and polkit, launched
# through the universal Wayland session manager.
programs.hyprland = {
enable = true;
withUWSM = true;
};
home-manager.users.${user}.wayland.windowManager.hyprland = {
enable = true;
# One package drives the whole session, so there is never a version split.
# The program integration above installs it and the portal, leaving home-
# manager to write only the config.
package = null;
portalPackage = null;
# uwsm owns the systemd graphical-session targets.
systemd.enable = false;
# Write the native Lua Hyprland config. Home Manager renders the Nix
# settings below as hl.* calls.
configType = "lua";
importantPrefixes = [ "config" ];
settings = {
config.general.layout = "dwindle";
bind = [
{
_args = [
"SUPER + Return"
(lib.generators.mkLuaInline ''hl.dsp.exec_cmd("ghostty")'')
];
}
];
};
};
};
}