feat: migrate host Hyprland overrides to Lua

This commit is contained in:
2026-08-01 10:53:09 +02:00
parent 4b65a6c3b1
commit 58fecf72df
2 changed files with 178 additions and 50 deletions
+92 -20
View File
@@ -7,7 +7,20 @@
lib,
...
}:
with lib; {
with lib; let
lua = lib.generators.mkLuaInline;
startupCommand = command: {
_args = [
"hyprland.start"
(lua ''
function()
hl.exec_cmd(${builtins.toJSON command})
end
'')
];
};
in {
config = mkMerge [
# ── XDG / MIME defaults ──
{
@@ -41,28 +54,87 @@ with lib; {
wayland.windowManager.hyprland = {
enable = true;
settings = {
exec-once = ["tuxedo-backlight"];
on = [
(startupCommand "tuxedo-backlight")
];
monitor = [
"eDP-1,preferred,0x0,1.25"
"HDMI-A-1,1920x1080@120,2560x0,1"
{
output = "eDP-1";
mode = "preferred";
position = "0x0";
scale = 1.25;
}
{
output = "HDMI-A-1";
mode = "1920x1080@120";
position = "2560x0";
scale = 1;
}
];
workspace = [
"1, monitor:eDP-1, default:true"
"2, monitor:eDP-1"
"3, monitor:eDP-1"
"4, monitor:HDMI-A-1"
"5, monitor:HDMI-A-1,border:false,rounding:false"
"6, monitor:HDMI-A-1"
workspace_rule = [
{
workspace = "1";
monitor = "eDP-1";
default = true;
}
{
workspace = "2";
monitor = "eDP-1";
}
{
workspace = "3";
monitor = "eDP-1";
}
{
workspace = "4";
monitor = "HDMI-A-1";
}
{
workspace = "5";
monitor = "HDMI-A-1";
no_border = true;
no_rounding = true;
}
{
workspace = "6";
monitor = "HDMI-A-1";
}
];
windowrule = [
"match:class dev.zed.Zed, workspace 1"
"match:class Msty, workspace 1"
"match:class ^(com.obsproject.Studio)$, workspace 2"
"match:class ^(brave-browser)$, workspace 4, opacity 1.0"
"match:class ^(vivaldi-stable)$, workspace 4, opacity 1.0"
"match:class ^steam_app_\\d+$, fullscreen on"
"match:class ^steam_app_\\d+$, workspace 5"
"match:class ^steam_app_\\d+$, idle_inhibit focus"
window_rule = [
{
match.class = "dev.zed.Zed";
workspace = "1";
}
{
match.class = "Msty";
workspace = "1";
}
{
match.class = "^(com.obsproject.Studio)$";
workspace = "2";
}
{
match.class = "^(brave-browser)$";
workspace = "4";
opacity = "1.0";
}
{
match.class = "^(vivaldi-stable)$";
workspace = "4";
opacity = "1.0";
}
{
match.class = "^steam_app_\\d+$";
fullscreen = true;
}
{
match.class = "^steam_app_\\d+$";
workspace = "5";
}
{
match.class = "^steam_app_\\d+$";
idle_inhibit = "focus";
}
];
};
};
+86 -30
View File
@@ -7,7 +7,14 @@
lib,
...
}:
with lib; {
with lib; let
mkEnvVar = name: value: {
_args = [
name
value
];
};
in {
imports = [
];
@@ -47,40 +54,89 @@ with lib; {
enable = true;
settings = {
monitor = [
"DP-1,2560x1440@144,0x0,1"
"DP-2,2560x1440@144,2560x0,1"
{
output = "DP-1";
mode = "2560x1440@144";
position = "0x0";
scale = 1;
}
{
output = "DP-2";
mode = "2560x1440@144";
position = "2560x0";
scale = 1;
}
];
workspace = [
"1, monitor:DP-1, default:true"
"2, monitor:DP-1"
"3, monitor:DP-1"
"4, monitor:DP-2"
"5, monitor:DP-2"
"6, monitor:DP-2"
"7, monitor:DP-2"
workspace_rule = [
{
workspace = "1";
monitor = "DP-1";
default = true;
}
{
workspace = "2";
monitor = "DP-1";
}
{
workspace = "3";
monitor = "DP-1";
}
{
workspace = "4";
monitor = "DP-2";
}
{
workspace = "5";
monitor = "DP-2";
}
{
workspace = "6";
monitor = "DP-2";
}
{
workspace = "7";
monitor = "DP-2";
}
];
# m3ta-home sets QT_QPA_PLATFORMTHEME=gtk3 globally for Hyprland.
# m3ta-home sets QT_QPA_PLATFORMTHEME to gtk3 globally for Hyprland.
# ksnip crashes with duplicate GDK type registration under that Qt GTK
# platform theme, so use qtct for Qt apps on this host instead.
env = mkForce [
"XCURSOR_SIZE,32"
"HYPRCURSOR_THEME,Bibata-Modern-Ice"
"WLR_NO_HARDWARE_CURSORS,1"
"XDG_CURRENT_DESKTOP,Hyprland"
"XDG_SESSION_TYPE,wayland"
"XDG_SESSION_DESKTOP,Hyprland"
"XKB_DEFAULT_LAYOUT,de"
"NIXOS_OZONE_WL,1"
"QT_QPA_PLATFORM,wayland;xcb"
"QT_QPA_PLATFORMTHEME,qt5ct"
"QT_QPA_PLATFORMTHEME_QT6,qt6ct"
"env" = mkForce [
(mkEnvVar "XCURSOR_SIZE" "32")
(mkEnvVar "HYPRCURSOR_THEME" "Bibata-Modern-Ice")
(mkEnvVar "WLR_NO_HARDWARE_CURSORS" "1")
(mkEnvVar "XDG_CURRENT_DESKTOP" "Hyprland")
(mkEnvVar "XDG_SESSION_TYPE" "wayland")
(mkEnvVar "XDG_SESSION_DESKTOP" "Hyprland")
(mkEnvVar "XKB_DEFAULT_LAYOUT" "de")
(mkEnvVar "NIXOS_OZONE_WL" "1")
(mkEnvVar "QT_QPA_PLATFORM" "wayland;xcb")
(mkEnvVar "QT_QPA_PLATFORMTHEME" "qt5ct")
(mkEnvVar "QT_QPA_PLATFORMTHEME_QT6" "qt6ct")
];
windowrule = [
"match:class dev.zed.Zed, workspace 1"
"match:class ^(com.obsproject.Studio)$, workspace 2"
"match:class ^(brave-browser)$, workspace 4, opacity 1.0"
"match:class ^(vivaldi-stable)$, workspace 4, opacity 1.0"
"match:class ^steam_app_\\d+$, idle_inhibit focus"
window_rule = [
{
match.class = "dev.zed.Zed";
workspace = "1";
}
{
match.class = "^(com.obsproject.Studio)$";
workspace = "2";
}
{
match.class = "^(brave-browser)$";
workspace = "4";
opacity = "1.0";
}
{
match.class = "^(vivaldi-stable)$";
workspace = "4";
opacity = "1.0";
}
{
match.class = "^steam_app_\\d+$";
idle_inhibit = "focus";
}
];
};
};