Files
nixos-config/hosts/m3-kratos/home.nix
T
m3tm3re 0d74e38ae7 feat(hyprland): migrate home configs to lua configType
- Switch from hyprlang (hyprland.conf) to lua (hyprland.lua) config format
- Use configType = "lua" explicitly for clarity
- Replace exec-once with on = { _args = [...] } hook for startup commands
- Convert windowrule strings to window_rule attribute-set syntax with
  mkLuaInline match objects and option sets per Home Manager module
- Change mkIf guard from config.desktop.wm.hyprland.enable to
  config.wayland.windowManager.hyprland.enable (correct option path)
- Preserve all existing host-specific monitor layouts and window rules
- Both configs: m3-ares (eDP-1 + HDMI) and m3-kratos (DP-1 + DP-2)
- Run alejandra after changes; parse validation passes (exit 0)

Refs:
  - https://github.com/nix-community/home-manager/blob/master/modules/services/window-managers/hyprland.nix
  - https://wiki.hypr.land/Configuring/Start/
2026-05-18 18:47:22 +02:00

113 lines
3.5 KiB
Nix

# hosts/m3-kratos/home.nix — Host-specific home-manager overrides.
# AMD desktop: dual 2560x1440@144 via DisplayPort.
# Everything else (shell, editors, gaming, media, theme, etc.) comes from
# m3ta-home via the profile mapping in hosts/common/users/m3tam3re.nix.
{
config,
lib,
...
}:
with lib; {
config = mkMerge [
# ── XDG / MIME defaults ──
{
xdg = {
enable = true;
configFile."mimeapps.list".force = true;
mimeApps = {
enable = true;
associations.added = {
"application/zip" = ["org.gnome.FileRoller.desktop"];
"application/csv" = ["calc.desktop"];
"application/pdf" = ["vivaldi-stable.desktop"];
"x-scheme-handler/http" = ["vivaldi-stable.desktop"];
"x-scheme-handler/https" = ["vivaldi-stable.desktop"];
};
defaultApplications = {
"application/zip" = ["org.gnome.FileRoller.desktop"];
"application/csv" = ["calc.desktop"];
"application/pdf" = ["vivaldi-stable.desktop"];
"application/md" = ["dev.zed.Zed.desktop"];
"application/text" = ["dev.zed.Zed.desktop"];
"x-scheme-handler/http" = ["vivaldi-stable.desktop"];
"x-scheme-handler/https" = ["vivaldi-stable.desktop"];
};
};
};
}
# ── Hyprland monitor layout ──
(mkIf config.wayland.windowManager.hyprland.enable {
wayland.windowManager.hyprland = {
enable = true;
configType = "lua";
settings = {
# Monitor configuration (dual 2560x1440@144 via DisplayPort)
monitor = [
"DP-1,2560x1440@144,0x0,1"
"DP-2,2560x1440@144,2560x0,1"
];
# Workspace assignment
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"
];
# Window rules using attribute-set syntax (match + options)
window_rule = [
{
_args = [
(lib.generators.mkLuaInline ''hl.dsp.window.match({ class = "dev.zed.Zed" })'')
{workspace = 1;}
];
}
{
_args = [
(lib.generators.mkLuaInline ''hl.dsp.window.match({ class = "Msty" })'')
{workspace = 1;}
];
}
{
_args = [
(lib.generators.mkLuaInline ''hl.dsp.window.match({ class = "com\\.obsproject\\.Studio" })'')
{workspace = 2;}
];
}
{
_args = [
(lib.generators.mkLuaInline ''hl.dsp.window.match({ class = "brave-browser" })'')
{
workspace = 4;
opacity = 1.0;
}
];
}
{
_args = [
(lib.generators.mkLuaInline ''hl.dsp.window.match({ class = "vivaldi-stable" })'')
{
workspace = 4;
opacity = 1.0;
}
];
}
{
_args = [
(lib.generators.mkLuaInline ''hl.dsp.window.match({ class = "steam_app_\\d+" })'')
{idle_inhibit = "focus";}
];
}
];
};
};
})
];
}