Files
dotfiles/nixos/hyprland.nix

70 lines
2.2 KiB
Nix
Raw Normal View History

{ config, pkgs, lib, makeEnable, inputs, ... }:
makeEnable config "myModules.hyprland" true {
programs.hyprland = {
enable = true;
# Use Hyprland from the flake for proper plugin compatibility
package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland;
};
2026-02-03 20:30:39 -08:00
home-manager.sharedModules = [
{
xdg.configFile."waybar" = {
source = ../dotfiles/config/waybar;
2026-02-03 20:30:39 -08:00
recursive = true;
force = true;
};
programs.waybar.enable = true;
2026-02-03 20:30:39 -08:00
systemd.user.targets.hyprland-session = {
Unit = {
Description = "Hyprland session";
};
};
2026-02-03 20:30:39 -08:00
systemd.user.services.waybar = {
Unit = {
Description = "Waybar";
PartOf = [ "hyprland-session.target" ];
After = [ "hyprland-session.target" ];
};
Service = {
ExecStartPre = "${pkgs.bash}/bin/bash -lc 'uid=$(id -u); for i in $(seq 1 50); do runtime_dir=\"$XDG_RUNTIME_DIR\"; if [ -z \"$runtime_dir\" ]; then runtime_dir=\"/run/user/$uid\"; fi; if [ -n \"$WAYLAND_DISPLAY\" ] && [ -S \"$runtime_dir/$WAYLAND_DISPLAY\" ]; then exit 0; fi; sleep 0.1; done; exit 1'";
ExecStart = "${pkgs.waybar}/bin/waybar";
Restart = "always";
RestartSec = 1;
};
Install = {
WantedBy = [ "hyprland-session.target" ];
};
2026-02-03 20:30:39 -08:00
};
programs.hyprpanel.enable = false;
2026-02-03 20:30:39 -08:00
}
];
# Hyprland-specific packages
environment.systemPackages = with pkgs; [
# Hyprland utilities
hyprpaper # Wallpaper
hypridle # Idle daemon
hyprlock # Screen locker
hyprcursor # Cursor themes
wl-clipboard # Clipboard for Wayland
cliphist # Clipboard history
grim # Screenshot utility
slurp # Region selection
swappy # Screenshot annotation
wlsunset # Night light / blue light filter
# hy3 plugin from flake (properly built against matching Hyprland)
inputs.hy3.packages.${pkgs.stdenv.hostPlatform.system}.hy3
# Hyprexpo plugin from hyprland-plugins (workspace overview)
inputs.hyprland-plugins.packages.${pkgs.stdenv.hostPlatform.system}.hyprexpo
# For scripts
jq
];
}