Files
nixos-config/home-manager/modules/hypr/hypr.nix
T
2026-01-28 00:39:46 +03:00

267 lines
7.3 KiB
Nix

{ config, pkgs, lib, inputs, ... }:
# TODO:
# - make hyprexpo work
{
imports = [
inputs.caelestia-shell.homeManagerModules.default
# ./hyprland/env.nix
# ./hyprland/execs.nix
# ./hyprland/general.nix
# ./hyprland/colors.nix
# ./hyprland/active.nix
./hyprland/rules.nix
./hyprland/keybinds.nix # done
# ./hyprlock.nix # done
./hypridle.nix # done
] ++ lib.optional (builtins.pathExists ./hyprland/my.nix) ./hyprland/my.nix;
programs.caelestia = {
enable = true;
systemd = {
enable = false; # if you prefer starting from your compositor
target = "graphical-session.target";
environment = [ ];
};
settings = {
# bar.status = { showBattery = false; };
# paths.wallpaperDir = "~/Images";
};
cli = {
enable = true; # Also add caelestia-cli to path
# settings = { theme.enableGtk = false; };
};
};
home.packages = with pkgs; [
(pkgs.writeScriptBin "wallpaper" (''
#!${pkgs.python311}/bin/python3
'' + (builtins.readFile ./scripts/wallpaper/wallpaper.py)))
hyprland
brightnessctl
playerctl
hyprshot
nemo
pywal
jq
xdg-desktop-portal
xdg-desktop-portal-gtk
xdg-desktop-portal-hyprland
xdg-desktop-portal-shana
# wayvnc # configure in future for auto start
];
programs.vicinae.enable = true;
services.swww.enable = true;
home.file.".config/hypr/scripts" = {
source = ./scripts;
recursive = true;
executable = true;
};
home.file.".config/background".source =
config.lib.file.mkOutOfStoreSymlink "/home/krosh/Pictures/wallpaper.png";
wayland.windowManager.hyprland = {
enable = true;
plugins = [ pkgs.hyprlandPlugins.hyprexpo ];
settings = {
xwayland = { force_zero_scaling = true; };
layerrule = [ "noanim, vicinae" "blur,vicinae" "ignorealpha 0, vicinae" ];
env = [ "XCURSOR_SIZE,24" "HYPRCURSOR_SIZE,24" ];
exec-once = [
"caelestia shell &"
"caelestia shell lock lock; until [ $? -eq 0 ]; do sleep 1; caelestia shell lock lock; done"
# "hyprlock --immediate-render --no-fade-in &"
"wal -R &"
# "swww img ${config.home.homeDirectory}/Pictures/wallpaper.png &"
"vicinae server &"
"gsettings set org.gnome.desktop.interface cursor-theme '${config.home.pointerCursor.name}'"
"gsettings set org.gnome.desktop.interface cursor-size ${
toString config.home.pointerCursor.size
}"
];
exec = "hyprctl dispatch submap global";
submap = "global";
debug = { disable_logs = false; };
monitor = [
# "eDP-1,preferred,0x0,1.25"
"eDP-1,preferred,0x0,1"
"HDMI-A-1,preferred,auto-left,auto"
"HDMI-A-2,preferred,auto-left,auto"
"vcl-samsung,2340x1080@30,0x864,2"
"vcl-xiaomi,1440x900@30,-900x0,1"
];
input = {
kb_layout = "us,ru";
kb_options = "grp:win_space_toggle,ctrl:swap_lalt_lctl";
natural_scroll = true;
follow_mouse = 1;
numlock_by_default = true;
scroll_method = "2fg";
touchpad = {
disable_while_typing = true;
clickfinger_behavior = true;
natural_scroll = true;
};
};
cursor = {
no_hardware_cursors = true;
min_refresh_rate = 60;
inactive_timeout = 5;
hide_on_key_press = true;
};
binds.scroll_event_delay = 0;
gesture = "3, horizontal, workspace";
gestures = {
workspace_swipe_distance = 700;
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;
};
general = {
# Gaps and border
gaps_in = 5;
gaps_out = 10;
gaps_workspaces = 50;
border_size = 0;
# Fallback colors
"col.active_border" = "rgba(0DB7D4FF)";
"col.inactive_border" = "rgba(31313600)";
resize_on_border = true;
no_focus_fallback = true;
# layout = dwindle
#focus_to_other_workspaces = true # ahhhh i still haven't properly implemented this
allow_tearing =
true; # This just allows the `immediate` window rule to work
snap.enabled = true;
};
dwindle = {
preserve_split = true;
smart_split = false;
smart_resizing = false;
};
decoration = {
rounding = 20;
blur = {
enabled = true;
xray = false;
special = false;
new_optimizations = true;
ignore_opacity = true;
size = 4;
passes = 2;
brightness = 1;
noise = "0.01";
contrast = 1;
popups = true;
popups_ignorealpha = "0.6";
vibrancy = 0;
};
shadow = {
enabled = true;
ignore_window = true;
range = 20;
offset = "0 2";
render_power = 4;
color = "rgba(0000002A)";
};
active_opacity = "0.95";
inactive_opacity = "0.5";
fullscreen_opacity = 1;
dim_inactive = true;
dim_strength = "0.025";
dim_special = "0.07";
};
animations = {
enabled = true;
bezier = [
"expressiveFastSpatial, 0.42, 1.67, 0.21, 0.90"
"expressiveSlowSpatial, 0.39, 1.29, 0.35, 0.98"
"expressiveDefaultSpatial, 0.38, 1.21, 0.22, 1.00"
"emphasizedDecel, 0.05, 0.7, 0.1, 1"
"emphasizedAccel, 0.3, 0, 0.8, 0.15"
"standardDecel, 0, 0, 0, 1"
"menu_decel, 0.1, 1, 0, 1"
"menu_accel, 0.52, 0.03, 0.72, 0.08"
];
animation = [
"windowsIn, 1, 3, emphasizedDecel, popin 80%"
"windowsOut, 1, 2, emphasizedDecel, popin 90%"
"windowsMove, 1, 3, emphasizedDecel, slide"
"border, 1, 10, emphasizedDecel"
"layersIn, 1, 2.7, emphasizedDecel, popin 93%"
"layersOut, 1, 2.4, menu_accel, popin 94%"
"fadeLayersIn, 1, 0.5, menu_decel"
"fadeLayersOut, 1, 2.7, menu_accel"
"workspaces, 1, 7, menu_decel, slide"
"specialWorkspaceIn, 1, 2.8, emphasizedDecel, slidevert"
"specialWorkspaceOut, 1, 1.2, emphasizedAccel, slidevert"
];
};
misc = {
mouse_move_enables_dpms = true;
key_press_enables_dpms = true;
disable_splash_rendering = true;
focus_on_activate = false;
vrr = 0;
# TODO: enable after rules.nix
# vfr = 1;
# vrr = 1;
animate_manual_resizes = false;
animate_mouse_windowdragging = false;
# enable_swallow = false;
# swallow_regex = "(foot|kitty|allacritty|Alacritty)";
# disable_hyprland_logo = true;
# force_default_wallpaper = 0;
new_window_takes_over_fullscreen = 2;
allow_session_lock_restore = true;
initial_workspace_tracking = false;
};
plugin.hyprexpo = {
columns = 3;
gap_size = 5;
bg_col = "rgb(000000)";
workspace_method =
"first 1"; # [center/first] [workspace] e.g. first 1 or center m+1
enable_gesture = true; # laptop touchpad, 4 fingers
gesture_distance = 300; # how far is the "max"
gesture_positive = false;
};
};
};
}