diff --git a/home-modules/hyprland.nix b/home-modules/hyprland/default.nix similarity index 75% rename from home-modules/hyprland.nix rename to home-modules/hyprland/default.nix index 0a13072..727dedb 100644 --- a/home-modules/hyprland.nix +++ b/home-modules/hyprland/default.nix @@ -1,64 +1,19 @@ { pkgs, ... } : { + imports = [ + ./hyprpaper.nix + ./hyprlock.nix + ./hypridle.nix + ./walker.nix + ./waybar.nix + ]; + + # Screenshots. home.packages = with pkgs; [ hyprshot ]; - programs.hyprlock = { - enable = true; - settings = { - background = { - monitor = ""; - color = "rgba(25, 20, 20, 1.0)"; - blur_passes = 2; - }; - input-field = { - monitor = ""; - size = "20%, 5%"; - outline_thickness = 3; - inner_color = "rgba(0, 0, 0, 0.0)"; # no fill - - outer_color = "rgba(33ccffee) rgba(00ff99ee) 45deg"; - check_color = "rgba(00ff99ee) rgba(ff6633ee) 120deg"; - fail_color = "rgba(ff6633ee) rgba(ff0066ee) 40deg"; - - font_color = "rgb(143, 143, 143)"; - fade_on_empty = false; - rounding = 15; - - position = "0, -20"; - halign = "center"; - valign = "center"; - }; - }; - }; - # TODO: Move to its own module. - services.hypridle = { - enable = true; - settings = { - general = { - lock_cmd = "pidof hyprlock || hyprlock"; # Avoid starting hyprlock multiple times. - before_sleep_cmd = "loginctl lock-session"; # lock before suspend. - after_sleep_cmd = "hyprctl dispatch dpms on"; # to avoid having to press a key twice to turn on the display. - }; - listener = [ - { - timeout = 150; # 2.5min. - on-timeout = "brightnessctl -s set 10"; # set monitor backlight to minimum, avoid 0 on OLED monitor. - on-resume = "brightnessctl -r"; # monitor backlight restore. - } - { - timeout = 300; # 5min. - on-timeout = "loginctl lock-session"; # lock screen when timeout has passed. - } - { - timeout = 330; # 5.5min - on-timeout = "hyprctl dispatch dpms off"; # screen off when timeout has passed - on-resume = "hyprctl dispatch dpms on && brightnessctl -r"; # screen on when activity is detected after timeout has fired. - } - ]; - }; - }; - # TODO: Move swaync to its own module if it ever gets more complex than just enalbement. + # Notifications daemon. services.swaync.enable = true; + wayland.windowManager.hyprland.enable = true; wayland.windowManager.hyprland.settings = { monitor = [ @@ -75,6 +30,10 @@ "HYPRCURSOR_SIZE,24" ]; + exec-once = [ + "sway-audio-idle-inhibit" # TODO: Check if it can be conditional on the package existing. + ]; + general = { gaps_in = 4; gaps_out = 8; diff --git a/home-modules/hyprland/hypridle.nix b/home-modules/hyprland/hypridle.nix new file mode 100644 index 0000000..950e69d --- /dev/null +++ b/home-modules/hyprland/hypridle.nix @@ -0,0 +1,28 @@ +{ ... } : { + services.hypridle = { + enable = true; + settings = { + general = { + lock_cmd = "pidof hyprlock || hyprlock"; # Avoid starting hyprlock multiple times. + before_sleep_cmd = "loginctl lock-session"; # lock before suspend. + after_sleep_cmd = "hyprctl dispatch dpms on"; # to avoid having to press a key twice to turn on the display. + }; + listener = [ + { + timeout = 150; # 2.5min. + on-timeout = "brightnessctl -s set 10"; # set monitor backlight to minimum, avoid 0 on OLED monitor. + on-resume = "brightnessctl -r"; # monitor backlight restore. + } + { + timeout = 300; # 5min. + on-timeout = "loginctl lock-session"; # lock screen when timeout has passed. + } + { + timeout = 330; # 5.5min + on-timeout = "hyprctl dispatch dpms off"; # screen off when timeout has passed + on-resume = "hyprctl dispatch dpms on && brightnessctl -r"; # screen on when activity is detected after timeout has fired. + } + ]; + }; + }; +} diff --git a/home-modules/hyprland/hyprlock.nix b/home-modules/hyprland/hyprlock.nix new file mode 100644 index 0000000..6300121 --- /dev/null +++ b/home-modules/hyprland/hyprlock.nix @@ -0,0 +1,30 @@ +{ ... } : { + programs.hyprlock = { + enable = true; + settings = { + background = { + monitor = ""; + color = "rgba(25, 20, 20, 1.0)"; + blur_passes = 2; + }; + input-field = { + monitor = ""; + size = "20%, 5%"; + outline_thickness = 3; + inner_color = "rgba(0, 0, 0, 0.0)"; # no fill + + outer_color = "rgba(33ccffee) rgba(00ff99ee) 45deg"; + check_color = "rgba(00ff99ee) rgba(ff6633ee) 120deg"; + fail_color = "rgba(ff6633ee) rgba(ff0066ee) 40deg"; + + font_color = "rgb(143, 143, 143)"; + fade_on_empty = false; + rounding = 15; + + position = "0, -20"; + halign = "center"; + valign = "center"; + }; + }; + }; +} diff --git a/home-modules/hyprpaper.nix b/home-modules/hyprland/hyprpaper.nix similarity index 100% rename from home-modules/hyprpaper.nix rename to home-modules/hyprland/hyprpaper.nix diff --git a/home-modules/walker.nix b/home-modules/hyprland/walker.nix similarity index 67% rename from home-modules/walker.nix rename to home-modules/hyprland/walker.nix index 2f3d03f..c02e40a 100644 --- a/home-modules/walker.nix +++ b/home-modules/hyprland/walker.nix @@ -1,4 +1,7 @@ -{ ... } : { +{ inputs, ... } : { + imports = [ + inputs.walker.homeManagerModules.default + ]; programs.walker = { enable = true; diff --git a/home-modules/waybar.nix b/home-modules/hyprland/waybar.nix similarity index 100% rename from home-modules/waybar.nix rename to home-modules/hyprland/waybar.nix diff --git a/hosts/asahi/home.nix b/hosts/asahi/home.nix index 1b63806..6004e93 100644 --- a/hosts/asahi/home.nix +++ b/hosts/asahi/home.nix @@ -13,11 +13,7 @@ in { imports = [ # TODO: Move all hyprland related config to its own module. - ../../home-modules/hyprland.nix - ../../home-modules/hyprpaper.nix - inputs.walker.homeManagerModules.default # TODO: Move to walker.nix? - ../../home-modules/walker.nix - ../../home-modules/waybar.nix + ../../home-modules/hyprland ../../home-modules/zsh.nix ../../home-modules/direnv.nix