aboutsummaryrefslogtreecommitdiffstats
path: root/modules/desktop/hyprland/default.nix
diff options
context:
space:
mode:
authorArpit Chakladar <arpitchakladar+git@gmail.com>2026-07-25 11:50:05 +0530
committerArpit Chakladar <arpitchakladar+git@gmail.com>2026-07-25 11:50:05 +0530
commit892b62a3129a6ae30fa6b039e3f88d370d418319 (patch)
tree5a25ed4be60fd2a29548ec1ed65c9b831d2ef4b2 /modules/desktop/hyprland/default.nix
parent6621b1998e6f02772adb2df2fc19343691b086cf (diff)
downloadhome-manager-config-892b62a3129a6ae30fa6b039e3f88d370d418319.tar.gz
home-manager-config-892b62a3129a6ae30fa6b039e3f88d370d418319.zip
feat(hyprland): migrate config to Lua, fix API calls, switch to hyprpaper
- Set configType = "lua" for Hyprland 0.55+ Lua config format - Rewrite window rules to use hl.window_rule({...}) table API - Convert keybindings to hl.bind() with _args + mkLuaInline - Fix dispatchers: hl.dsp.focus (not window.focus), hl.dsp.focus({workspace=}) (not workspace.switch) - Replace swaybg with services.hyprpaper module for wallpaper - Fix border colors to use base07 (white) / base03 (grey) with rgba() format - Reduce default font size from 16 to 12
Diffstat (limited to 'modules/desktop/hyprland/default.nix')
-rw-r--r--modules/desktop/hyprland/default.nix126
1 files changed, 126 insertions, 0 deletions
diff --git a/modules/desktop/hyprland/default.nix b/modules/desktop/hyprland/default.nix
new file mode 100644
index 0000000..bd80157
--- /dev/null
+++ b/modules/desktop/hyprland/default.nix
@@ -0,0 +1,126 @@
+{
+ config,
+ lib,
+ pkgs,
+ ...
+}:
+let
+ toHyprColor = hex: "rgba(${lib.removePrefix "#" hex}ff)";
+in
+{
+ imports = [
+ ./keybindings.nix
+ ];
+
+ options.desktop.hyprland = {
+ enable = lib.mkEnableOption "Hyprland Wayland compositor";
+ };
+
+ config = lib.mkIf config.desktop.hyprland.enable {
+ wayland.windowManager.hyprland = {
+ enable = true;
+ configType = "lua";
+ xwayland.enable = true;
+ systemd.enable = true;
+
+ settings = {
+ mainMod = {
+ _var = "SUPER";
+ };
+
+ config = {
+ general = with config.scheme.withHashtag; {
+ gaps_in = 5;
+ gaps_out = 5;
+ border_size = 1;
+ col = {
+ active_border = {
+ colors = [ (toHyprColor base07) ];
+ angle = 45;
+ };
+ inactive_border = toHyprColor base03;
+ };
+ layout = "dwindle";
+ };
+
+ decoration = {
+ rounding = 0;
+ };
+
+ input = {
+ follow_mouse = 1;
+ kb_layout = "us";
+ };
+
+ dwindle = {
+ preserve_split = true;
+ };
+ };
+
+ window_rule = [
+ {
+ name = "float-file-explorer";
+ match.class = "^(file-explorer)$";
+ float = true;
+ }
+ {
+ name = "size-file-explorer";
+ match.class = "^(file-explorer)$";
+ size = "1280 720";
+ }
+ {
+ name = "center-file-explorer";
+ match.class = "^(file-explorer)$";
+ center = true;
+ }
+
+ {
+ name = "float-application-launcher";
+ match.class = "^(application-launcher)$";
+ float = true;
+ }
+ {
+ name = "size-application-launcher";
+ match.class = "^(application-launcher)$";
+ size = "800 600";
+ }
+ {
+ name = "center-application-launcher";
+ match.class = "^(application-launcher)$";
+ center = true;
+ }
+
+ {
+ name = "float-keybindings-viewer";
+ match.class = "^(keybindings-viewer)$";
+ float = true;
+ }
+ {
+ name = "size-keybindings-viewer";
+ match.class = "^(keybindings-viewer)$";
+ size = "1280 720";
+ }
+ {
+ name = "center-keybindings-viewer";
+ match.class = "^(keybindings-viewer)$";
+ center = true;
+ }
+ ];
+ };
+ };
+
+ services.hyprpaper = lib.mkIf config.media.feh.enable {
+ enable = true;
+ settings = {
+ preload = [ "${../../../assets/sapling.png}" ];
+ wallpaper = [ ",${../../../assets/sapling.png}" ];
+ };
+ };
+
+ home.packages = with pkgs; [
+ grim
+ slurp
+ wl-clipboard
+ ];
+ };
+}