From 0751537bcbce6a36ee4ffe486d1c09e40d3c82dd Mon Sep 17 00:00:00 2001 From: cnst Date: Tue, 16 Jul 2024 10:06:56 +0200 Subject: [PATCH] hyprland --- flake.lock | 6 +- flake.nix | 20 ------ home/core/gui/hypr/default.nix | 28 ++++++++ home/core/gui/hypr/land/default.nix | 19 +++++ home/core/gui/hypr/land/settings.nix | 100 +++++++++++++++++++++++++++ home/users/cnst/imports.nix | 1 + nixos/core/hyprland.nix | 11 ++- 7 files changed, 155 insertions(+), 30 deletions(-) create mode 100644 home/core/gui/hypr/default.nix create mode 100644 home/core/gui/hypr/land/default.nix create mode 100644 home/core/gui/hypr/land/settings.nix diff --git a/flake.lock b/flake.lock index 2bb81f2c..26d06752 100644 --- a/flake.lock +++ b/flake.lock @@ -70,11 +70,11 @@ ] }, "locked": { - "lastModified": 1721063790, - "narHash": "sha256-Q4TODTbyTfFngmRmrLnE/9pgIeE9vmwq7iZx7g2fVuQ=", + "lastModified": 1721100106, + "narHash": "sha256-+W47GD9QdHKVyfK/S5G448VbMIfJEUPvdQl0uQn60p0=", "owner": "nix-community", "repo": "flake-firefox-nightly", - "rev": "35bd6d4ec6afd87e7c5d8a6c370effbe9c777e86", + "rev": "15534c73a87a6c735e5f2077dd3de235ed00ec13", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index d3373460..6341392c 100644 --- a/flake.nix +++ b/flake.nix @@ -40,26 +40,6 @@ # inputs.nixpkgs.follows = "nixpkgs"; #}; # ags.url = "github:Aylur/ags"; - - # HYPRLAND ECOSYSTEM - hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1"; - - hypridle = { - url = "github:hyprwm/hypridle"; - inputs = { - hyprlang.follows = "hyprland/hyprlang"; - nixpkgs.follows = "hyprland/nixpkgs"; - systems.follows = "hyprland/systems"; - }; - }; - hyprlock = { - url = "github:hyprwm/hyprlock"; - inputs = { - hyprlang.follows = "hyprland/hyprlang"; - nixpkgs.follows = "hyprland/nixpkgs"; - systems.follows = "hyprland/systems"; - }; - }; }; outputs = { self, diff --git a/home/core/gui/hypr/default.nix b/home/core/gui/hypr/default.nix new file mode 100644 index 00000000..7d5c89ac --- /dev/null +++ b/home/core/gui/hypr/default.nix @@ -0,0 +1,28 @@ +{ + wayland.windowManager.hyprland = { + enable = true; + settings = { + source = [ + "./land/appearance.conf" + "./land/inputs.conf" + "./land/keybinds.conf" + "./land/rules.conf" + "./land/startup.conf" + ]; + }; + + systemd = { + variables = ["--all"]; + extraCommands = [ + "systemctl --user stop graphical-session.target" + "systemctl --user start hyprland-session.target" + ]; + }; + }; + + home.sessionVariables = { + QT_QPA_PLATFORM = "wayland"; + SDL_VIDEODRIVER = "wayland"; + XDG_SESSION_TYPE = "wayland"; + }; +} diff --git a/home/core/gui/hypr/land/default.nix b/home/core/gui/hypr/land/default.nix new file mode 100644 index 00000000..cb90bbc9 --- /dev/null +++ b/home/core/gui/hypr/land/default.nix @@ -0,0 +1,19 @@ +{inputs, ...}: { + imports = [ + inputs.hyprland.homeManagerModules.default + ./binds.nix + ./rules.nix + ./settings.nix + ]; + wayland.windowManager.hyprland = { + enable = true; + + systemd = { + variables = ["--all"]; + extraCommands = [ + "systemctl --user stop graphical-session.target" + "systemctl --user start hyprland-session.target" + ]; + }; + }; +} diff --git a/home/core/gui/hypr/land/settings.nix b/home/core/gui/hypr/land/settings.nix new file mode 100644 index 00000000..3a76c52e --- /dev/null +++ b/home/core/gui/hypr/land/settings.nix @@ -0,0 +1,100 @@ +{ + wayland.windowManager.hyprland.settings = { + monitor = [ + "DP-3,2560x1440@143.86,auto,1" + "eDP-1,1920x1200@60.02,auto,1" + ]; + general = { + gaps_in = 2; + gaps_out = 4; + border_size = 3; + #col.active_border = "rgba(33ccffee) rgba(00ff99ee) 45deg"; + #col.inactive_border = "rgba(595959aa)"; + col.active_border = "rgb(689d6a)"; # rgba(b16286ee) 45deg + col.inactive_border = "rgb(504945)"; + layout = "dwindle"; + }; + + decoration = { + rounding = 0; + blur = { + enabled = true; + size = 8; + passes = 1; + vibrancy = 0.1696; + }; + + drop_shadow = false; + shadow_range = 4; + shadow_render_power = 3; + # col.shadow = "rgba(1a1a1aee)"; + }; + + animations = { + enabled = true; + bezier = ["myBezier, 0.05, 0.9, 0.1, 1.05"]; + animation = [ + "windows, 1, 3, myBezier" + "windowsOut, 1, 3, default, popin 80%" + "border, 1, 3, default" + "borderangle, 1, 8, default" + "fade, 1, 7, default" + "workspaces, 1, 3, default" + ]; + }; + + dwindle = { + # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more + pseudotile = true; # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below + preserve_split = true; # you probably want this + }; + + input = { + follow_mouse = 1; + accel_profile = "flat"; + sensitivity = 0; # -1.0 - 1.0, 0 means no modification. + + touchpad = { + natural_scroll = true; + disable_while_typing = true; + clickfinger_behavior = true; + scroll_factor = 0.5; + }; + }; + # Desktop keyboard + device = { + name = "pfu-limited-hhkb-hybrid"; + kb_layout = "hhkbse"; + kb_options = "lv3:rwin_switch"; + }; + device = { + name = "hhkb-hybrid_1-keyboard"; + kb_layout = "hhkbse"; + kb_options = "lv3:rwin_switch"; + }; + # Laptop keyboard + device = { + name = "at-translated-set-2-keyboard"; + kb_layout = "se"; + kb_options = "ctrl:swapcaps"; + }; + gestures = { + workspace_swipe = true; + workspace_swipe_distance = 400; + workspace_swipe_fingers = 3; + workspace_swipe_cancel_ratio = 0.2; + workspace_swipe_min_speed_to_force = 5; + workspace_swipe_direction_lock = true; + workspace_swipe_direction_lock_threshold = 10; + workspace_swipe_create_new = true; + }; + misc = { + vrr = 2; + mouse_move_enables_dpms = 1; + key_press_enables_dpms = 0; + force_default_wallpaper = 0; + disable_hyprland_logo = true; + disable_splash_rendering = true; + }; + }; +} diff --git a/home/users/cnst/imports.nix b/home/users/cnst/imports.nix index 320fe6fc..10a127d5 100644 --- a/home/users/cnst/imports.nix +++ b/home/users/cnst/imports.nix @@ -6,6 +6,7 @@ ../../core/gui/browsers ../../core/gui/xdg ../../core/gui/discord + ../../core/gui/hypr # core.tui ../../core/tui/git/cnst.nix ../../core/tui/shell/cnst.nix diff --git a/nixos/core/hyprland.nix b/nixos/core/hyprland.nix index 0774f03b..c0eec64c 100644 --- a/nixos/core/hyprland.nix +++ b/nixos/core/hyprland.nix @@ -1,13 +1,10 @@ -{inputs, ...}: { - imports = [ - inputs.hyprland.nixosModules.default - ]; +{ programs.hyprland = { enable = true; - xwayland.enable = true; + # xwayland.enable = true; }; - environment.sessionVariables = { - MOZ_ENABLE_WAYLAND = 1; + environment.variables = { + # MOZ_ENABLE_WAYLAND = 1; NIXOS_OZONE_WL = "1"; # AMD_VULKAN_ICD = "RADV"; # SDL_VIDEODRIVER = "wayland";