nixos/modules/hyprland.nix
Zynh Ludwig 278ac18a5a hyprland: anyrun
hyprland: anyrun reorg
2025-03-19 16:16:49 -07:00

144 lines
3.3 KiB
Nix

{ lib, config, pkgs, inputs, ... }:
let
cfg = config.snowhawk.hyprland;
in
{
options.snowhawk.hyprland = {
enable = lib.mkEnableOption "hyprland";
};
config = lib.mkIf cfg.enable (lib.mkMerge [
# Core Module
{
services.graphical-desktop.enable = lib.mkDefault true;
services.displayManager = {
enable = true;
sddm = {
enable = lib.mkDefault true;
wayland.enable = lib.mkDefault true;
};
};
security = {
polkit.enable = lib.mkDefault true;
};
programs = {
dconf.enable = lib.mkDefault true;
xwayland.enable = lib.mkDefault true;
};
xdg.portal = {
enable = true;
extraPortals = [
pkgs.xdg-desktop-portal-gtk
];
};
programs.waybar.enable = true;
programs.hyprland = {
enable = true;
withUWSM = true;
xwayland.enable = true;
};
services.hypridle.enable = true;
systemd.user.services.hypridle.path = [ pkgs.brightnessctl ];
# programs.hyprlock.enable = true;
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1050913
xdg.portal.config.hyprland.default = lib.mkDefault [ "wlr" "gtk" ];
services.xserver.desktopManager.runXdgAutostartIfNone = lib.mkDefault true;
environment.variables = {
QT_QPA_PLATFORM = "wayland;xcb";
MOZ_ENABLE_WAYLAND = 1;
SDL_VIDEODRIVEWR = "wayland,x11";
_JAVA_AWT_WM_NONREPARENTING = 1;
};
environment.systemPackages = with pkgs; [
# Screenshotting
grim
slurp
satty
# Hardware Control
brightnessctl
# Desktop
wofi
kitty
pipewire-controller
# Wayland Utilities
wdisplays
xorg.xlsclients
wl-clipboard
];
home-manager.sharedModules = [
./home/hyprland.nix
];
}
# SDDM Theme
(
let sddmPkg = (pkgs.sddm-astronaut.override { embeddedTheme = "purple_leaves"; });
in {
services.displayManager = {
enable = lib.mkDefault true;
sddm = {
enable = lib.mkDefault true;
wayland.enable = lib.mkDefault true;
theme = "sddm-astronaut-theme";
package = pkgs.kdePackages.sddm;
extraPackages = with pkgs; [
sddmPkg
kdePackages.qtsvg
kdePackages.qtvirtualkeyboard
kdePackages.qtmultimedia
];
};
};
environment.systemPackages = [ sddmPkg ];
}
)
# Anyrun
{
home-manager.sharedModules = [{
imports = [
inputs.anyrun.homeManagerModules.default
];
programs.anyrun = {
enable = true;
config = {
x = { fraction = 0.5; };
y = { fraction = 0.3; };
width = { fraction = 0.3; };
layer = "overlay";
showResultsImmediately = true;
hidePluginInfo = true;
plugins = [
inputs.anyrun.packages.${pkgs.system}.applications
];
};
extraCss = /* css */ ''
window {
background: transparent;
}
'';
};
}];
}
]);
}