{ user ? throw "user argument is required", home ? throw "home argument is required", }: { config, lib, pkgs, ... }: { programs.hyprland.enable = true; home-manager.users.${user} = { imports = [ ./options.nix ]; wayland.windowManager.hyprland = { enable = true; settings = { "$mod" = "Super_L"; "$term" = lib.meta.getExe pkgs.kitty; bind = let bindHelper = lib.meta.getExe ( pkgs.writeShellApplication { name = "hyprland-bind-helper"; bashOptions = [ "errexit" "pipefail" ]; runtimeInputs = with pkgs; [ hyprland ]; text = builtins.readFile ./scripts/bind.sh; } ); in [ "$mod, Return, exec, $term" "$mod, 1, exec, ${bindHelper} 1" "$mod, 2, exec, ${bindHelper} 2" "$mod, 3, exec, ${bindHelper} 3" "$mod, 4, exec, ${bindHelper} 4" "$mod, 5, exec, ${bindHelper} 5" "$mod, 6, exec, ${bindHelper} 6" "$mod, 7, exec, ${bindHelper} 7" "$mod, 8, exec, ${bindHelper} 8" "$mod, 9, exec, ${bindHelper} 9" "$mod, 0, exec, ${bindHelper} 10" "$mod_Shift, 1, exec, ${bindHelper} 1 move" "$mod_Shift, 2, exec, ${bindHelper} 2 move" "$mod_Shift, 3, exec, ${bindHelper} 3 move" "$mod_Shift, 4, exec, ${bindHelper} 4 move" "$mod_Shift, 5, exec, ${bindHelper} 5 move" "$mod_Shift, 6, exec, ${bindHelper} 6 move" "$mod_Shift, 7, exec, ${bindHelper} 7 move" "$mod_Shift, 8, exec, ${bindHelper} 8 move" "$mod_Shift, 9, exec, ${bindHelper} 9 move" "$mod_Shift, 0, exec, ${bindHelper} 1 move0" "$mod, left, movefocus, l" "$mod, h, movefocus, l" "$mod, down, movefocus, d" "$mod, j, movefocus, d" "$mod, up, movefocus, u" "$mod, k, movefocus, u" "$mod, right, movefocus, r" "$mod, l, movefocus, r" "$mod_Shift, left, movewindow, l" "$mod_Shift, h, movewindow, l" "$mod_Shift, down, movewindow, d" "$mod_Shift, j, movewindow, d" "$mod_Shift, up, movewindow, u" "$mod_Shift, k, movewindow, u" "$mod_Shift, right, movewindow, r" "$mod_Shift, l, movewindow, r" "$mod, Tab, cyclenext" "$mod, Tab, bringactivetotop" "$mod_Shift, Tab, cyclenext, prev" "$mod_Shift, Tab, bringactivetotop" "$mod, f, fullscreen, 0" "$mod, m, fullscreen, 1" "$mod, p, pin" "$mod, Space, togglefloating" "$mod, Space, centerwindow" "$mod, q, killactive" "Ctrl_Alt, Delete, exit" ]; binde = [ "$mod_Ctrl, left, resizeactive, -20 0" "$mod_Ctrl, h, resizeactive, -20 0" "$mod_Ctrl, down, resizeactive, 0 20" "$mod_Ctrl, j, resizeactive, 0 20" "$mod_Ctrl, up, resizeactive, 0 -20" "$mod_Ctrl, k, resizeactive, 0 -20" "$mod_Ctrl, right, resizeactive, 20 0" "$mod_Ctrl, l, resizeactive, 20 0" ]; bindm = [ "$mod, mouse:272, movewindow" "$mod, mouse:273, resizewindow" ]; input = { accel_profile = "flat"; kb_layout = "us,gr"; kb_options = "grp:alt_shift_toggle"; }; gestures = { workspace_swipe = true; workspace_swipe_min_fingers = true; workspace_swipe_forever = true; workspace_swipe_cancel_ratio = 0.2; }; misc = { disable_hyprland_logo = true; disable_splash_rendering = true; new_window_takes_over_fullscreen = 2; }; decoration.blur = { passes = 2; popups = true; }; input.touchpad.natural_scroll = true; xwayland.force_zero_scaling = true; }; extraConfig = "source = ./theme.conf"; }; programs.zsh.loginExtra = lib.mkAfter '' if [ -z "$WAYLAND_DISPLAY" ] && [ -n "$XDG_VTNR" ] && [ "$XDG_VTNR" -eq 1 ]; then Hyprland 2> >(systemd-cat -p err -t hyprland) 1> >(systemd-cat -p info -t hyprland) fi ''; theme = { template."${home}/.config/hypr/theme.conf".source = ./theme.conf; reloadExtraConfig = "${ lib.meta.getExe ( pkgs.writeShellApplication { name = "reload-hyprland"; runtimeInputs = with pkgs; [ hyprland ]; text = "exec hyprctl reload"; } ) } &"; }; home.sessionVariables.NIXOS_OZONE_WL = "1"; }; }