370 lines
11 KiB
Nix
370 lines
11 KiB
Nix
{ config, lib, pkgs, pkgs-24_05, variant, ... }: {
|
|
home.packages = with pkgs; [ xdg-desktop-portal-hyprland ];
|
|
|
|
home.sessionVariables = {
|
|
NIXOS_OZONE_WL = "1";
|
|
GDK_BACKEND = "wayland,x11";
|
|
QT_QPA_PLATFORM = "wayland;xcb";
|
|
CLUTTER_BACKEND = "wayland";
|
|
XDG_CURRENT_DESKTOP = "Hyprland";
|
|
XDG_SESSION_TYPE = "wayland";
|
|
XDG_SESSION_DESKTOP = "Hyprland";
|
|
QT_AUTO_SCREEN_SCALE_FACTOR = "1";
|
|
XCURSOR_SIZE = "24";
|
|
DXVK_FILTER_DEVICE_NAME="NVIDIA";
|
|
};
|
|
|
|
wayland.windowManager.hyprland = {
|
|
enable = true;
|
|
package = if variant == "allegro" then pkgs-24_05.hyprland else pkgs.hyprland;
|
|
xwayland.enable = true;
|
|
|
|
systemd.enable = true;
|
|
systemd.variables = [ "--all" ];
|
|
|
|
|
|
settings = {
|
|
debug = {
|
|
disable_logs = false;
|
|
};
|
|
input = {
|
|
kb_layout = "fr";
|
|
kb_variant = "";
|
|
kb_model = "pc105";
|
|
kb_options = "ctrl:nocaps";
|
|
kb_rules = "";
|
|
|
|
touchpad = {
|
|
natural_scroll = "no";
|
|
};
|
|
|
|
sensitivity = 0.0;
|
|
numlock_by_default = true;
|
|
|
|
repeat_delay = 200;
|
|
repeat_rate = 50;
|
|
force_no_accel = true;
|
|
follow_mouse = 2;
|
|
};
|
|
|
|
general = {
|
|
gaps_in = 0;
|
|
gaps_out = 0;
|
|
border_size = 0;
|
|
"col.active_border" = "rgb(000000)";
|
|
"col.inactive_border" = "rgba(00000000)";
|
|
layout = "dwindle";
|
|
};
|
|
|
|
decoration = {
|
|
blur = {
|
|
enabled = true;
|
|
};
|
|
drop_shadow = true;
|
|
shadow_range = 8;
|
|
shadow_render_power = 4;
|
|
"col.shadow_inactive" = "rgba(1a1a1a33)";
|
|
"col.shadow" = "rgba(1a1a1aee)";
|
|
};
|
|
|
|
animations = {
|
|
enabled = true;
|
|
bezier = "myBezier, 0, 0, .58, 1";
|
|
animation = "global, 1, 1, myBezier";
|
|
};
|
|
|
|
dwindle = {
|
|
pseudotile = true;
|
|
preserve_split = true;
|
|
force_split = 2;
|
|
# no_gaps_when_only = true;
|
|
};
|
|
|
|
gestures = {
|
|
workspace_swipe = "off";
|
|
};
|
|
|
|
misc = {
|
|
disable_hyprland_logo = true;
|
|
enable_swallow = true;
|
|
mouse_move_enables_dpms = true;
|
|
key_press_enables_dpms = true;
|
|
swallow_regex = "^(Alacritty)(.*)$";
|
|
# swallow_regex = "^(kitty)(.*)$";
|
|
};
|
|
|
|
|
|
windowrule = "float, floating";
|
|
layerrule = "blur, waybar";
|
|
|
|
"$mod" = "SUPER";
|
|
|
|
bind = [
|
|
"$mod, q, killactive"
|
|
"$mod SHIFT, q, exec, kill -9 $(hyprctl activewindow | grep pid | grep -E -o '[0-9]+$')"
|
|
"$mod, a, togglefloating"
|
|
"$mod SHIFT, a, workspaceopt, allfloat"
|
|
"$mod, Tab, togglesplit"
|
|
"$mod, P, pseudo"
|
|
"$mod, f, fullscreen"
|
|
|
|
"$mod, Return, exec, $TERMINAL"
|
|
"$mod SHIFT, e, exec, rofimoji"
|
|
"$mod, c, exec, rofi -show calc -modi calc -no-show-match -no-sort"
|
|
"$mod, e, exec, $TERMINAL -e lf"
|
|
"$mod SHIFT, Return, exec, $TERMINAL --working-directory \"$(window_dir)\""
|
|
"$mod, w, exec, $BROWSER"
|
|
"$mod SHIFT, w, exec, firefox --private-window"
|
|
"$mod SHIFT, s, exec, TMP=$(rofi -dmenu -p \"nix search\" -l 0) && $BROWSER \"https://search.nixos.org/packages?channel=unstable&query=$TMP\""
|
|
"$mod SHIFT, e, exec, $(rofi -dmenu -p \"command\" -l 0)"
|
|
"$mod, m, exec, $TERMINAL --class floating -e pulsemixer"
|
|
"$mod, d, exec, ~/.bin/runmenu"
|
|
"$mod, x, exec, keepmenu"
|
|
"$mod, z, exec, tmux new -spopup_terminal -d; $TERMINAL --class floating -e tmux a -t popup_terminal"
|
|
"$mod, f11, exec, ocrzone"
|
|
"$mod, f12, exec, $TERMINAL --class floating -e nmtui"
|
|
"$mod, f2, exec, darkman toggle"
|
|
"$mod, f3, exec, hyprctl reload"
|
|
"$mod, f4, exec, rofi-udisk"
|
|
"$mod, f5, exec, mount-android"
|
|
|
|
",XF86AudioRaiseVolume, exec, pamixer -i 5"
|
|
",XF86AudioLowerVolume, exec, pamixer -d 5"
|
|
",XF86AudioMute, exec, pamixer -t"
|
|
",XF86AudioMicMute, exec, pamixer -t --default-source"
|
|
|
|
",XF86MonBrightnessUp, exec, light -A 10"
|
|
",XF86MonBrightnessDown, exec, light -U 10"
|
|
|
|
"$mod,Print, exec, screenshot"
|
|
|
|
"$mod, agrave, submap, power"
|
|
|
|
"$mod, h, movefocus, l"
|
|
"$mod, l, movefocus, r"
|
|
"$mod, k, movefocus, u"
|
|
"$mod, j, movefocus, d"
|
|
|
|
"$mod, Left, movefocus, l"
|
|
"$mod, Right, movefocus, r"
|
|
"$mod, Up, movefocus, u"
|
|
"$mod, Down, movefocus, d"
|
|
|
|
"$mod SHIFT, h, movewindow, l"
|
|
"$mod SHIFT, l, movewindow, r"
|
|
"$mod SHIFT, k, movewindow, u"
|
|
"$mod SHIFT, j, movewindow, d"
|
|
|
|
# "$mod SHIFT, Left, movewindow, l"
|
|
# "$mod SHIFT, Right, movewindow, r"
|
|
# "$mod SHIFT, Up, movewindow, u"
|
|
# "$mod SHIFT, Down, movewindow, d"
|
|
|
|
"$mod, twosuperior, workspace, 1"
|
|
"$mod, ampersand, workspace, 2"
|
|
"$mod, eacute, workspace, 3"
|
|
"$mod, quotedbl, workspace, 4"
|
|
"$mod, apostrophe, workspace, 5"
|
|
"$mod, parenleft, workspace, 6"
|
|
"$mod, minus, workspace, 7"
|
|
"$mod, egrave, workspace, 8"
|
|
"$mod, underscore, workspace, 9"
|
|
"$mod, ccedilla, workspace, 10"
|
|
"$mod, rarenright, workspace, 11"
|
|
|
|
"$mod SHIFT, twosuperior, movetoworkspacesilent, 1"
|
|
"$mod SHIFT, ampersand, movetoworkspacesilent, 2"
|
|
"$mod SHIFT, eacute, movetoworkspacesilent, 3"
|
|
"$mod SHIFT, quotedbl, movetoworkspacesilent, 4"
|
|
"$mod SHIFT, apostrophe, movetoworkspacesilent, 5"
|
|
"$mod SHIFT, parenleft, movetoworkspacesilent, 6"
|
|
"$mod SHIFT, minus, movetoworkspacesilent, 7"
|
|
"$mod SHIFT, egrave, movetoworkspacesilent, 8"
|
|
"$mod SHIFT, underscore, movetoworkspacesilent, 9"
|
|
"$mod SHIFT, ccedilla, movetoworkspacesilent, 10"
|
|
"$mod SHIFT, rarenright, movetoworkspacesilent, 11"
|
|
|
|
"$mod ALT, twosuperior, focusworkspaceoncurrentmonitor, 1"
|
|
"$mod ALT, ampersand, focusworkspaceoncurrentmonitor, 2"
|
|
"$mod ALT, eacute, focusworkspaceoncurrentmonitor, 3"
|
|
"$mod ALT, quotedbl, focusworkspaceoncurrentmonitor, 4"
|
|
"$mod ALT, apostrophe, focusworkspaceoncurrentmonitor, 5"
|
|
"$mod ALT, parenleft, focusworkspaceoncurrentmonitor, 6"
|
|
"$mod ALT, minus, focusworkspaceoncurrentmonitor, 7"
|
|
"$mod ALT, egrave, focusworkspaceoncurrentmonitor, 8"
|
|
"$mod ALT, underscore, focusworkspaceoncurrentmonitor, 9"
|
|
"$mod ALT, ccedilla, focusworkspaceoncurrentmonitor, 10"
|
|
"$mod ALT, rarenright, focusworkspaceoncurrentmonitor, 11"
|
|
];
|
|
|
|
bindm = [
|
|
"$mod, mouse:272, movewindow"
|
|
"$mod, mouse:273, resizewindow"
|
|
];
|
|
|
|
binde = [
|
|
"$mod CTRL SHIFT, h, moveactive, -60 0"
|
|
"$mod CTRL SHIFT, l, moveactive, 60 0"
|
|
"$mod CTRL SHIFT, k, moveactive, 0 -60"
|
|
"$mod CTRL SHIFT, j, moveactive, 0 60"
|
|
"$mod CTRL, h, resizeactive, -60 0"
|
|
"$mod CTRL, l, resizeactive, 60 0"
|
|
"$mod CTRL, k, resizeactive, 0 -60"
|
|
"$mod CTRL, j, resizeactive, 0 60"
|
|
|
|
"$mod SHIFT, Left, moveactive, -60 0"
|
|
"$mod SHIFT, Right, moveactive, 60 0"
|
|
"$mod SHIFT, Up, moveactive, 0 -60"
|
|
"$mod SHIFT, Down, moveactive, 0 60"
|
|
"$mod CTRL, Left, resizeactive, -60 0"
|
|
"$mod CTRL, Right, resizeactive, 60 0"
|
|
"$mod CTRL, Up, resizeactive, 0 -60"
|
|
"$mod CTRL, Down, resizeactive, 0 60"
|
|
];
|
|
|
|
# plugin:hyprfocus {
|
|
# enabled = no;
|
|
#
|
|
# keyboard_focus_animation = shrink
|
|
# mouse_focus_animation = flash
|
|
#
|
|
# bezier = bezIn, 0.5,0.0,1.0,0.5
|
|
# bezier = bezOut, 0.0,0.5,0.5,1.0
|
|
#
|
|
# flash {
|
|
# flash_opacity = 0.7
|
|
#
|
|
# in_bezier = bezIn
|
|
# in_speed = 0.5
|
|
#
|
|
# out_bezier = bezOut
|
|
# out_speed = 3
|
|
# }
|
|
#
|
|
# shrink {
|
|
# shrink_percentage = 0.8
|
|
#
|
|
# in_bezier = bezIn
|
|
# in_speed = 0.5
|
|
#
|
|
# out_bezier = bezOut
|
|
# out_speed = 3
|
|
# }
|
|
# }
|
|
|
|
# "plugin:hyprfocus" = {
|
|
# enabled = true;
|
|
|
|
# keyboard_focus_animation = "flash";
|
|
# mouse_focus_animation = "nothing";
|
|
|
|
# bezier = "bezIn, 0.5,0.0,1.0,0.5";
|
|
# # bezier = "bezOut, 0.0,0.5,0.5,1.0";
|
|
|
|
# flash = {
|
|
# shrink_percentage = 0.8;
|
|
|
|
# in_bezier = "bezIn";
|
|
# in_speed = 0.5;
|
|
|
|
# out_bezier = "bezIn";
|
|
# out_speed = 3;
|
|
# };
|
|
|
|
# shrink = {
|
|
# shrink_percentage = 0.8;
|
|
|
|
# in_bezier = "bezIn";
|
|
# in_speed = 0.5;
|
|
|
|
# out_bezier = "bezIn";
|
|
# out_speed = 3;
|
|
# };
|
|
# };
|
|
|
|
};
|
|
|
|
extraConfig =
|
|
let
|
|
swaybgScript = (pkgs.writers.writeFish "display-background" ''
|
|
# find background image: only file in ~/.local/share/bg
|
|
set -l bg (find ~/.local/share/bg -type l)
|
|
|
|
${pkgs.swaybg}/bin/swaybg -m fill -i $bg
|
|
|
|
# set background
|
|
# ${pkgs.nix}/bin/nix-shell \
|
|
# -p pkgs.rubyPackages.gdk_pixbuf2 \
|
|
# --run "${pkgs.swaybg}/bin/swaybg -m fill -i $bg"
|
|
'');
|
|
monitors = if (variant == "default") then ''
|
|
monitor=,highrr,auto,1,vrr,1
|
|
''
|
|
else if variant == "moon" then ''
|
|
monitor=,preferred,auto,1
|
|
''
|
|
else if variant == "allegro" then ''
|
|
monitor=eDP-1, 1920x1080, 0x0, 1
|
|
monitor= DP-3, 1920x1200, 1920x0, 1
|
|
monitor= DP-4, 1920x1200, 3840x0, 1
|
|
monitor=HDMI-1, 1920x1080, auto, 1, mirror, eDP-1
|
|
monitor=HDMI-A-1, 1920x1080, auto, 1, mirror, eDP-1
|
|
''
|
|
else ''
|
|
'';
|
|
in
|
|
''
|
|
${monitors}
|
|
|
|
${ # system specific configs
|
|
if variant == "default" then ''
|
|
env = GBM_BACKEND,nvidia-drm
|
|
env = __GLX_VENDOR_LIBRARY_NAME,nvidia
|
|
''
|
|
else if variant == "allegro" then ''
|
|
env = WLR_DRM_DEVICES,/dev/dri/card0
|
|
env = AQ_WLR_DEVICES,/dev/ri/card0
|
|
env = AQ_DRM_DEVICES,/dev/dri/card0
|
|
env = TERMINAL,alacritty
|
|
|
|
env = NIXOS_OZONE_WL,1
|
|
env = GDK_BACKEND,wayland,x11
|
|
env = QT_QPA_PLATFORM,wayland;xcb
|
|
env = CLUTTER_BACKEND,wayland
|
|
env = XDG_CURRENT_DESKTOP,Hyprland
|
|
env = XDG_SESSION_TYPE,wayland
|
|
env = XDG_SESSION_DESKTOP,Hyprland
|
|
env = QT_AUTO_SCREEN_SCALE_FACTOR,1
|
|
env = WLR_NO_HARDWARE_CURSORS,1
|
|
env = XCURSOR_SIZE,24
|
|
'' else ''
|
|
''
|
|
}
|
|
|
|
exec = pkill swaybg; ${swaybgScript}
|
|
exec = pkill waybar; ${pkgs.waybar}/bin/waybar
|
|
|
|
submap = power
|
|
bind = ,s, exec, systemctl suspend
|
|
bind = ,s, submap, reset
|
|
|
|
bind = SHIFT,S,exec, shutdown now
|
|
bind = ,S, submap, reset
|
|
|
|
bind = ,h, exec, systemctl hibernate
|
|
bind = ,h, submap, reset
|
|
|
|
bind = ,e, exit
|
|
bind = ,e, submap, reset
|
|
|
|
bind = ,r, exec, reboot
|
|
bind = ,r, submap, reset
|
|
|
|
bind = ,l, exec, swaylock
|
|
bind = ,l, submap, reset
|
|
|
|
bind = ,escape, submap, reset
|
|
submap = reset
|
|
'';
|
|
};
|
|
}
|