diff --git a/home.nix b/home.nix index a777a3c..84bb246 100644 --- a/home.nix +++ b/home.nix @@ -20,7 +20,6 @@ in { ./modules/firefox.nix ./modules/git.nix ./modules/gpg.nix - ./modules/hyprland.nix ./modules/i3.nix ./modules/kubernetes.nix ./modules/mail.nix @@ -30,6 +29,7 @@ in { ./modules/rice.nix ./modules/sops.nix ./modules/vscode.nix + ./modules/wayland.nix ./modules/wezterm.nix ./modules/zsh.nix ] diff --git a/modules/hyprland.nix b/modules/hyprland.nix deleted file mode 100644 index 163e881..0000000 --- a/modules/hyprland.nix +++ /dev/null @@ -1,46 +0,0 @@ -{ - config, - flakePath, - lib, - pkgs, - ... -}: let - inherit (pkgs.stdenv.hostPlatform) isLinux; - nvidiaPrefix = "GDM_BACKEND=nvidia-drm LIBVA_DRIVER_NAME=nvidia __GLX_VENDOR_LIBRARY_NAME=nvidia WLR_NO_HARDWARE_CURSORS=1"; - waylandPrefix = "XDG_SESSION_TYPE=wayland NIXOS_OZONE_WL=1"; -in { - home.shellAliases = lib.mkIf isLinux { - "Hyprland" = "${nvidiaPrefix} ${waylandPrefix} Hyprland"; - "sway" = "${nvidiaPrefix} ${waylandPrefix} sway"; - }; - wayland = lib.mkIf isLinux { - windowManager = { - sway = { - enable = true; - extraOptions = ["--unsupported-gpu"]; - config = { - modifier = "Mod4"; - keybindings = let - modifier = config.wayland.windowManager.sway.config.modifier; - in - lib.mkOptionDefault { - "${modifier}+Shift+Return" = "exec ${lib.getExe pkgs.wezterm}-gui"; - "${modifier}+Shift+q" = "kill"; - "${modifier}+space" = "exec ${lib.getExe pkgs.rofi-wayland} -show drun"; - }; - }; - }; - hyprland = { - enable = true; - nvidiaPatches = true; - xwayland = { - enable = true; - hidpi = true; - }; - }; - }; - }; - xdg = lib.mkIf isLinux { - configFile."hypr/hyprland.conf".source = config.lib.file.mkOutOfStoreSymlink "${flakePath}/modules/hyprland/hyprland.conf"; - }; -} diff --git a/modules/hyprland/hyprland.conf b/modules/hyprland/hyprland.conf deleted file mode 100644 index ea801dd..0000000 --- a/modules/hyprland/hyprland.conf +++ /dev/null @@ -1,67 +0,0 @@ -monitor = ,5120x2160@72,0x0,1.5 - -input:follow_mouse = 1 - -general { - gaps_in = 0 - gaps_out = 0 - border_size = 2 - no_cursor_warps = true - col.active_border = 0xfff5c2e7 - col.inactive_border = 0x80cba6f7 -} - -decoration { - rounding = 0 - blur = 0 -} - -animations { - enabled = 1 - animation = workspaces,1,1,default,slide -} - -misc { - disable_hyprland_logo = true - disable_splash_rendering = true -} - -bind = SUPER_SHIFT,return,exec,wezterm -bind = SUPER_SHIFT,q,killactive, -bind = SUPER_SHIFT,M,exit, -bind = SUPER_SHIFT,d,togglefloating, -bind = SUPER,space,exec,rofi -show drun - -bind = SUPER_CTRL,l,movefocus,l -bind = SUPER_CTRL,h,movefocus,r -bind = SUPER_CTRL,k,movefocus,u -bind = SUPER_CTRL,j,movefocus,d -bind = SUPER_SHIFT,h,movewindow,l -bind = SUPER_SHIFT,l,movewindow,r -bind = SUPER_SHIFT,j,movewindow,u -bind = SUPER_SHIFT,k,movewindow,d - -bind = SUPER_CTRL,1,workspace,1 -bind = SUPER_CTRL,2,workspace,2 -bind = SUPER_CTRL,3,workspace,3 -bind = SUPER_CTRL,4,workspace,4 -bind = SUPER_CTRL,5,workspace,5 -bind = SUPER_CTRL,6,workspace,6 -bind = SUPER_CTRL,7,workspace,7 -bind = SUPER_CTRL,8,workspace,8 -bind = SUPER_CTRL,9,workspace,9 -bind = SUPER_CTRL,0,workspace,10 - -bind = SUPER_SHIFT,1,movetoworkspace,1 -bind = SUPER_SHIFT,2,movetoworkspace,2 -bind = SUPER_SHIFT,3,movetoworkspace,3 -bind = SUPER_SHIFT,4,movetoworkspace,4 -bind = SUPER_SHIFT,5,movetoworkspace,5 -bind = SUPER_SHIFT,6,movetoworkspace,6 -bind = SUPER_SHIFT,7,movetoworkspace,7 -bind = SUPER_SHIFT,8,movetoworkspace,8 -bind = SUPER_SHIFT,9,movetoworkspace,9 -bind = SUPER_SHIFT,0,movetoworkspace,10 - -bindm = SUPER,mouse:272,movewindow -bindm = SUPER,mouse:273,resizewindow diff --git a/modules/wayland.nix b/modules/wayland.nix new file mode 100644 index 0000000..bedab90 --- /dev/null +++ b/modules/wayland.nix @@ -0,0 +1,114 @@ +{ + config, + flakePath, + lib, + pkgs, + ... +}: let + inherit (pkgs.stdenv.hostPlatform) isLinux; + nvidiaPrefix = "GDM_BACKEND=nvidia-drm LIBVA_DRIVER_NAME=nvidia __GLX_VENDOR_LIBRARY_NAME=nvidia WLR_NO_HARDWARE_CURSORS=1"; + waylandPrefix = "XDG_SESSION_TYPE=wayland NIXOS_OZONE_WL=1"; +in { + home.shellAliases = lib.mkIf isLinux { + "Hyprland" = "${nvidiaPrefix} ${waylandPrefix} Hyprland"; + "sway" = "${nvidiaPrefix} ${waylandPrefix} sway"; + }; + wayland = lib.mkIf isLinux { + windowManager = { + sway = { + enable = true; + extraOptions = ["--unsupported-gpu"]; + config = { + modifier = "Mod4"; + keybindings = let + modifier = config.wayland.windowManager.sway.config.modifier; + in + lib.mkOptionDefault { + "${modifier}+Shift+Return" = "exec ${lib.getExe pkgs.wezterm}-gui"; + "${modifier}+Shift+q" = "kill"; + "${modifier}+space" = "exec ${lib.getExe pkgs.rofi-wayland} -show drun"; + }; + }; + }; + hyprland = { + enable = true; + nvidiaPatches = true; + xwayland = { + enable = true; + hidpi = true; + }; + }; + }; + }; + xdg = lib.mkIf isLinux { + configFile."hypr/hyprland.conf".text = '' + monitor = ,5120x2160@72,0x0,1.5 + + input:follow_mouse = 1 + + general { + gaps_in = 0 + gaps_out = 0 + border_size = 2 + no_cursor_warps = true + col.active_border = 0xfff5c2e7 + col.inactive_border = 0x80cba6f7 + } + + decoration { + rounding = 0 + blur = 0 + } + + animations { + enabled = 1 + animation = workspaces,1,1,default,slide + } + + misc { + disable_hyprland_logo = true + disable_splash_rendering = true + } + + bind = SUPER_SHIFT,return,exec,wezterm + bind = SUPER_SHIFT,q,killactive, + bind = SUPER_SHIFT,M,exit, + bind = SUPER_SHIFT,d,togglefloating, + bind = SUPER,space,exec,rofi -show drun + + bind = SUPER_CTRL,l,movefocus,l + bind = SUPER_CTRL,h,movefocus,r + bind = SUPER_CTRL,k,movefocus,u + bind = SUPER_CTRL,j,movefocus,d + bind = SUPER_SHIFT,h,movewindow,l + bind = SUPER_SHIFT,l,movewindow,r + bind = SUPER_SHIFT,j,movewindow,u + bind = SUPER_SHIFT,k,movewindow,d + + bind = SUPER_CTRL,1,workspace,1 + bind = SUPER_CTRL,2,workspace,2 + bind = SUPER_CTRL,3,workspace,3 + bind = SUPER_CTRL,4,workspace,4 + bind = SUPER_CTRL,5,workspace,5 + bind = SUPER_CTRL,6,workspace,6 + bind = SUPER_CTRL,7,workspace,7 + bind = SUPER_CTRL,8,workspace,8 + bind = SUPER_CTRL,9,workspace,9 + bind = SUPER_CTRL,0,workspace,10 + + bind = SUPER_SHIFT,1,movetoworkspace,1 + bind = SUPER_SHIFT,2,movetoworkspace,2 + bind = SUPER_SHIFT,3,movetoworkspace,3 + bind = SUPER_SHIFT,4,movetoworkspace,4 + bind = SUPER_SHIFT,5,movetoworkspace,5 + bind = SUPER_SHIFT,6,movetoworkspace,6 + bind = SUPER_SHIFT,7,movetoworkspace,7 + bind = SUPER_SHIFT,8,movetoworkspace,8 + bind = SUPER_SHIFT,9,movetoworkspace,9 + bind = SUPER_SHIFT,0,movetoworkspace,10 + + bindm = SUPER,mouse:272,movewindow + bindm = SUPER,mouse:273,resizewindow + ''; + }; +}