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, 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 [ config = mkMerge [
# ── XDG / MIME defaults ── # ── XDG / MIME defaults ──
{ {
@@ -41,28 +54,87 @@ with lib; {
wayland.windowManager.hyprland = { wayland.windowManager.hyprland = {
enable = true; enable = true;
settings = { settings = {
exec-once = ["tuxedo-backlight"]; on = [
(startupCommand "tuxedo-backlight")
];
monitor = [ 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 = [ workspace_rule = [
"1, monitor:eDP-1, default:true" {
"2, monitor:eDP-1" workspace = "1";
"3, monitor:eDP-1" monitor = "eDP-1";
"4, monitor:HDMI-A-1" default = true;
"5, monitor:HDMI-A-1,border:false,rounding:false" }
"6, monitor:HDMI-A-1" {
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 = [ window_rule = [
"match:class dev.zed.Zed, workspace 1" {
"match:class Msty, workspace 1" match.class = "dev.zed.Zed";
"match:class ^(com.obsproject.Studio)$, workspace 2" workspace = "1";
"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 = "Msty";
"match:class ^steam_app_\\d+$, workspace 5" workspace = "1";
"match:class ^steam_app_\\d+$, idle_inhibit focus" }
{
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, lib,
... ...
}: }:
with lib; { with lib; let
mkEnvVar = name: value: {
_args = [
name
value
];
};
in {
imports = [ imports = [
]; ];
@@ -47,40 +54,89 @@ with lib; {
enable = true; enable = true;
settings = { settings = {
monitor = [ 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 = [ workspace_rule = [
"1, monitor:DP-1, default:true" {
"2, monitor:DP-1" workspace = "1";
"3, monitor:DP-1" monitor = "DP-1";
"4, monitor:DP-2" default = true;
"5, monitor:DP-2" }
"6, monitor:DP-2" {
"7, monitor:DP-2" 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 # ksnip crashes with duplicate GDK type registration under that Qt GTK
# platform theme, so use qtct for Qt apps on this host instead. # platform theme, so use qtct for Qt apps on this host instead.
env = mkForce [ "env" = mkForce [
"XCURSOR_SIZE,32" (mkEnvVar "XCURSOR_SIZE" "32")
"HYPRCURSOR_THEME,Bibata-Modern-Ice" (mkEnvVar "HYPRCURSOR_THEME" "Bibata-Modern-Ice")
"WLR_NO_HARDWARE_CURSORS,1" (mkEnvVar "WLR_NO_HARDWARE_CURSORS" "1")
"XDG_CURRENT_DESKTOP,Hyprland" (mkEnvVar "XDG_CURRENT_DESKTOP" "Hyprland")
"XDG_SESSION_TYPE,wayland" (mkEnvVar "XDG_SESSION_TYPE" "wayland")
"XDG_SESSION_DESKTOP,Hyprland" (mkEnvVar "XDG_SESSION_DESKTOP" "Hyprland")
"XKB_DEFAULT_LAYOUT,de" (mkEnvVar "XKB_DEFAULT_LAYOUT" "de")
"NIXOS_OZONE_WL,1" (mkEnvVar "NIXOS_OZONE_WL" "1")
"QT_QPA_PLATFORM,wayland;xcb" (mkEnvVar "QT_QPA_PLATFORM" "wayland;xcb")
"QT_QPA_PLATFORMTHEME,qt5ct" (mkEnvVar "QT_QPA_PLATFORMTHEME" "qt5ct")
"QT_QPA_PLATFORMTHEME_QT6,qt6ct" (mkEnvVar "QT_QPA_PLATFORMTHEME_QT6" "qt6ct")
]; ];
windowrule = [ window_rule = [
"match:class dev.zed.Zed, workspace 1" {
"match:class ^(com.obsproject.Studio)$, workspace 2" match.class = "dev.zed.Zed";
"match:class ^(brave-browser)$, workspace 4, opacity 1.0" workspace = "1";
"match:class ^(vivaldi-stable)$, workspace 4, opacity 1.0" }
"match:class ^steam_app_\\d+$, idle_inhibit focus" {
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";
}
]; ];
}; };
}; };