feat: created integration of all hypr ecosystem components

This commit is contained in:
Zhongheng Liu 2024-08-09 17:06:39 +08:00
commit 7af26d3e3f
7 changed files with 92 additions and 19 deletions

View file

@ -0,0 +1,9 @@
{pkgs, config, lib, ...}:
{
imports = [
./hyprland.nix
./hyprpaper.nix
./hypridle.nix
./hyprlock.nix
];
}

View file

@ -0,0 +1,22 @@
{pkgs, ...}:
let
timeoutSeconds = 60;
in
{
services.hypridle = {
enable = true;
settings = {
general = {
after_sleep_cmd = "hyprctl dispatch dpms on";
ignore_dbus_inhibit = false;
lock_cmd = "hyprlock";
};
listener = [
{
timeout = timeoutSeconds;
on-timeout = "hyprlock";
}
];
};
};
}

View file

@ -0,0 +1,60 @@
{config, pkgs, ... }:
{
home.packages = with pkgs; [
foot
];
wayland.windowManager.hyprland = {
# Whether to enable Hyprland wayland compositor
enable = true;
# The hyprland package to use
package = pkgs.hyprland;
plugins = with pkgs.hyprlandPlugins; [
hyprbars
hyprfocus
csgo-vulkan-fix
];
# Whether to enable XWayland
xwayland.enable = true;
settings = {
misc = {
disable_hyprland_logo = true;
disable_splash_rendering = true;
font_family = "monospace";
};
"$mod" = "SUPER";
bind = [
"$mod, Q, killactive"
"$mod, D, exec, ${pkgs.fuzzel}/bin/fuzzel"
# firefox quickstart
"$mod, F, exec, ${pkgs.firefox}/bin/firefox"
# foot terminal
"$mod, Return, exec, ${pkgs.foot}/bin/foot -f 'BlexMono Nerd Font:size=16' zsh"
] ++ (
# workspaces
# binds $mod + [shift +] {1..10} to [move to] workspace {1..10}
builtins.concatLists (builtins.genList (
x: let
ws = let
c = (x + 1) / 10;
in
builtins.toString (x + 1 - (c * 10));
in [
"$mod, ${ws}, workspace, ${toString (x + 1)}"
"$mod SHIFT, ${ws}, movetoworkspace, ${toString (x + 1)}"
]
)
10)
);
bindm = [
# mouse movements
"$mod, mouse:272, movewindow"
"$mod, mouse:273, resizewindow"
"$mod ALT, mouse:272, resizewindow"
];
};
# Optional
# Whether to enable hyprland-session.target on hyprland startup
systemd.enable = true;
};
# ...
}

View file

@ -0,0 +1,39 @@
{pkgs, config, lib, ...}:
{
programs.hyprlock = {
enable = true;
settings = {
general = {
disable_loading_bar = true;
grace = 10;
hide_cursor = true;
no_fade_in = false;
};
background = [
{
path = "screenshot";
blur_passes = 3;
blur_size = 8;
}
];
input-field = [
{
size = "200, 50";
position = "0, -80";
monitor = "";
dots_center = true;
fade_on_empty = false;
font_color = "rgb(202, 211, 245)";
inner_color = "rgb(91, 96, 120)";
outer_color = "rgb(24, 25, 38)";
outline_thickness = 5;
#placeholder_text = '\'<span foreground="##cad3f5">Password...</span>'\';
shadow_passes = 2;
}
];
};
};
}

View file

@ -0,0 +1,12 @@
{pkgs, config, ...}:
{
services.hyprpaper = {
enable = true;
settings = {
ipc = "on";
splash = false;
preload = [ config.myWallPaperPathString ];
wallpaper = [ ",${config.myWallPaperPathString}" ];
};
};
}