laptop-config/modules/hyprland.nix
2026-05-16 17:00:29 -07:00

72 lines
1.7 KiB
Nix

{config, pkgs, lib, ...}:
{
# === Wayland + Hyprland ===
programs.hyprland = {
enable = true;
xwayland.enable = true;
};
# Session variables
environment.sessionVariables.NIXOS_OZONE_WL = "1";
# Security — required for hyprlock
security.pam.services.hyprlock = {};
# Polkit for GUI auth prompts
security.polkit.enable = true;
systemd.user.services.polkit-gnome-authentication-agent-1 = {
description = "polkit-gnome-authentication-agent-1";
wantedBy = [ "graphical-session.target" ];
wants = [ "graphical-session.target" ];
after = [ "graphical-session.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
Restart = "on-failure";
RestartSec = 1;
};
};
# Display manager — SDDM (stable for Hyprland, doesn't lock TTYs)
services.displayManager.sddm = {
enable = true;
wayland.enable = true;
};
# Force Hyprland (non-uwsm) as default SDDM session
services.displayManager.session = [{
manage = "window";
desktopName = "Hyprland";
wmCommand = "Hyprland";
}];
# XDG portal for Wayland
xdg.portal = {
enable = true;
extraPortals = [ pkgs.xdg-desktop-portal-hyprland ];
config.common.default = "*";
};
# Fonts
fonts.packages = with pkgs; [
font-awesome
nerd-fonts.jetbrains-mono
nerd-fonts.fira-code
];
# Audio (pipewire)
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
# Bluetooth
hardware.bluetooth.enable = true;
hardware.bluetooth.powerOnBoot = true;
# NetworkManager applet
programs.nm-applet.enable = true;
}