feat: complete host home.nix files + add m3-daedalus, clean up m3tam3re.nix

- hosts/m3-kratos/home.nix: XDG/MIME defaults + dual DP Hyprland monitors
- hosts/m3-ares/home.nix: XDG/MIME defaults + eDP+HDMI Hyprland monitors
- hosts/m3-daedalus/home.nix: XDG/MIME defaults (no Hyprland)
- hosts/common/users/m3tam3re.nix: refactored hostFlags into let binding,
  added m3-daedalus profile (desktop/coding+media, no gaming/Hyprland)
This commit is contained in:
2026-05-02 10:41:12 +02:00
parent f2ecd13780
commit 5cbb975c78
4 changed files with 328 additions and 161 deletions

View File

@@ -5,6 +5,11 @@
# 2. Loads the m3ta-home profile system via mkHome # 2. Loads the m3ta-home profile system via mkHome
# 3. Sets per-host feature flags based on a host profile mapping # 3. Sets per-host feature flags based on a host profile mapping
# 4. Imports per-host home.nix overrides (monitors, HW-specific config) # 4. Imports per-host home.nix overrides (monitors, HW-specific config)
#
# To add a new host:
# 1. Add entry to hostProfiles below
# 2. Add feature flags in the hostFlags section
# 3. Create hosts/<hostname>/home.nix if the host needs overrides (monitors, etc.)
{ {
config, config,
pkgs, pkgs,
@@ -15,8 +20,8 @@
# ── Per-host profile mapping ── # ── Per-host profile mapping ──
# Determines which m3ta-home context and sets each host gets. # Determines which m3ta-home context and sets each host gets.
# To add a new host: add an entry here + create hosts/<hostname>/home.nix if needed.
hostProfiles = { hostProfiles = {
# ── Desktop hosts ──
m3-ares = { m3-ares = {
context = "desktop"; context = "desktop";
sets = ["coding" "gaming" "media"]; sets = ["coding" "gaming" "media"];
@@ -25,6 +30,11 @@
context = "desktop"; context = "desktop";
sets = ["coding" "gaming" "media"]; sets = ["coding" "gaming" "media"];
}; };
m3-daedalus = {
context = "desktop";
sets = ["coding" "media"];
};
# ── Server hosts ──
m3-atlas = { m3-atlas = {
context = "server"; context = "server";
sets = ["coding"]; sets = ["coding"];
@@ -43,12 +53,156 @@
}; };
}; };
profile = hostProfiles.${hostname} or {context = "server"; sets = [];}; profile = hostProfiles.${hostname} or {
context = "server";
sets = [];
};
m3ta-lib = inputs.m3ta-home.lib; m3ta-lib = inputs.m3ta-home.lib;
# Check if a per-host home.nix exists # Check if a per-host home.nix exists
hostHomeFile = ./../../${hostname}/home.nix; hostHomeFile = ./../../${hostname}/home.nix;
hostHomeExists = builtins.pathExists hostHomeFile; hostHomeExists = builtins.pathExists hostHomeFile;
# ── Per-host feature flags ──
# These enable/disable specific m3ta-home modules per host.
hostFlags =
if hostname == "m3-ares" || hostname == "m3-kratos"
then {
# Full desktop workstation
base = {
shell = {
fish.enable = true;
nushell.enable = true;
starship.enable = true;
};
cliTools = {
fzf.enable = true;
nitch.enable = true;
television.enable = true;
};
secrets.enable = true;
};
desktop = {
wm = {
hyprland.enable = true;
rofi.enable = true;
wayland.enable = true;
};
apps = {
crypto.enable = true;
obsidian.enable = true;
office.enable = true;
};
theme = {
fonts.enable = true;
wallpapers.enable = true;
};
};
coding = {
editors = {
neovim.enable = true;
zed.enable = true;
};
lsp.enable = true;
packages.enable = true;
languages = {
python.enable = true;
javascript.enable = true;
rustToolchain.enable = true;
go.enable = true;
typescript.enable = true;
};
};
profiles.gaming = {
steam.enable = true;
gamescope.enable = true;
};
profiles.media = {
obs.enable = true;
ffmpeg.enable = true;
kdenlive.enable = true;
ytDlp.enable = true;
};
}
else if hostname == "m3-daedalus"
then {
# Portable laptop — desktop without gaming, no Hyprland
base = {
shell = {
fish.enable = true;
nushell.enable = true;
starship.enable = true;
};
cliTools = {
fzf.enable = true;
nitch.enable = true;
television.enable = true;
};
secrets.enable = true;
};
desktop = {
wm = {
hyprland.enable = false;
wayland.enable = false;
};
apps = {
crypto.enable = false;
obsidian.enable = true;
office.enable = false;
};
theme = {
fonts.enable = true;
wallpapers.enable = false;
};
};
coding = {
editors = {
neovim.enable = true;
zed.enable = true;
};
lsp.enable = true;
packages.enable = true;
languages = {
python.enable = true;
javascript.enable = true;
rustToolchain.enable = true;
go.enable = true;
typescript.enable = true;
};
};
profiles.media = {
ytDlp.enable = true;
};
}
else if hostname == "m3-atlas"
then {
# Primary server — coding capable
base = {
shell = {
nushell.enable = true;
starship.enable = true;
};
cliTools = {
fzf.enable = true;
nitch.enable = true;
zellij.enable = true;
};
};
coding.editors.neovim.enable = true;
}
else {
# m3-helios, m3-hermes, m3-aether — minimal server
base = {
shell = {
fish.enable = true;
starship.enable = true;
};
cliTools = {
fzf.enable = true;
nitch.enable = true;
};
};
};
in { in {
# ── NixOS user definition ── # ── NixOS user definition ──
users.users.m3tam3re = { users.users.m3tam3re = {
@@ -86,104 +240,10 @@ in {
identity = "private"; identity = "private";
inherit (profile) context sets; inherit (profile) context sets;
}) })
# Per-host feature flags
hostFlags
] ]
# Per-host feature flag overrides # Per-host home.nix (Hyprland monitors, XDG/MIME, HW-specific overrides)
++ (
if hostname == "m3-ares" || hostname == "m3-kratos"
then [
# Desktop feature flags (both desktop hosts are identical)
{
base = {
shell = {
fish.enable = true;
nushell.enable = true;
starship.enable = true;
};
cliTools = {
fzf.enable = true;
nitch.enable = true;
television.enable = true;
};
secrets.enable = true;
};
desktop = {
wm = {
hyprland.enable = true;
rofi.enable = true;
wayland.enable = true;
};
apps = {
crypto.enable = true;
obsidian.enable = true;
office.enable = true;
};
theme = {
fonts.enable = true;
wallpapers.enable = true;
};
};
coding = {
editors = {
neovim.enable = true;
zed.enable = true;
};
lsp.enable = true;
packages.enable = true;
languages = {
python.enable = true;
javascript.enable = true;
rustToolchain.enable = true;
go.enable = true;
typescript.enable = true;
};
};
profiles.gaming = {
steam.enable = true;
gamescope.enable = true;
};
profiles.media = {
obs.enable = true;
ffmpeg.enable = true;
kdenlive.enable = true;
ytDlp.enable = true;
};
}
]
else if hostname == "m3-atlas"
then [
{
base = {
shell = {
nushell.enable = true;
starship.enable = true;
};
cliTools = {
fzf.enable = true;
nitch.enable = true;
zellij.enable = true;
};
};
coding.editors.neovim.enable = true;
}
]
else
# m3-helios, m3-hermes, m3-aether — minimal server
[
{
base = {
shell = {
fish.enable = true;
starship.enable = true;
};
cliTools = {
fzf.enable = true;
nitch.enable = true;
};
};
}
]
)
# Per-host home.nix (Hyprland monitors, HW-specific overrides)
++ ( ++ (
if hostHomeExists if hostHomeExists
then [hostHomeFile] then [hostHomeFile]

View File

@@ -1,36 +1,71 @@
# hosts/m3-ares/home.nix — Host-specific home-manager overrides. # hosts/m3-ares/home.nix — Host-specific home-manager overrides.
# TUXEDO laptop: internal display + HDMI monitor. # TUXEDO laptop: eDP-1 + HDMI-A-1 external monitor.
{config, lib, ...}: # 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; { with lib; {
# ── Hyprland monitor layout ── config = mkMerge [
config = mkIf config.desktop.wm.hyprland.enable { # ── XDG / MIME defaults ──
wayland.windowManager.hyprland = { {
enable = true; xdg = {
settings = { enable = true;
exec-once = ["tuxedo-backlight"]; configFile."mimeapps.list".force = true;
monitor = [ mimeApps = {
"eDP-1,preferred,0x0,1.25" enable = true;
"HDMI-A-1,1920x1080@120,2560x0,1" associations.added = {
]; "application/zip" = ["org.gnome.FileRoller.desktop"];
workspace = [ "application/csv" = ["calc.desktop"];
"1, monitor:eDP-1, default:true" "application/pdf" = ["vivaldi-stable.desktop"];
"2, monitor:eDP-1" "x-scheme-handler/http" = ["vivaldi-stable.desktop"];
"3, monitor:eDP-1" "x-scheme-handler/https" = ["vivaldi-stable.desktop"];
"4, monitor:HDMI-A-1," };
"5, monitor:HDMI-A-1,border:false,rounding:false" defaultApplications = {
"6, monitor:HDMI-A-1" "application/zip" = ["org.gnome.FileRoller.desktop"];
]; "application/csv" = ["calc.desktop"];
windowrule = [ "application/pdf" = ["vivaldi-stable.desktop"];
"match:class dev.zed.Zed, workspace 1" "application/md" = ["dev.zed.Zed.desktop"];
"match:class Msty, workspace 1" "application/text" = ["dev.zed.Zed.desktop"];
"match:class ^(com.obsproject.Studio)$, workspace 2" "x-scheme-handler/http" = ["vivaldi-stable.desktop"];
"match:class ^(brave-browser)$, workspace 4, opacity 1.0" "x-scheme-handler/https" = ["vivaldi-stable.desktop"];
"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"
];
}; };
}; }
};
# ── Hyprland monitor layout ──
(mkIf config.desktop.wm.hyprland.enable {
wayland.windowManager.hyprland = {
enable = true;
settings = {
exec-once = ["tuxedo-backlight"];
monitor = [
"eDP-1,preferred,0x0,1.25"
"HDMI-A-1,1920x1080@120,2560x0,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"
];
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"
];
};
};
})
];
} }

View File

@@ -0,0 +1,37 @@
# hosts/m3-daedalus/home.nix — Host-specific home-manager overrides.
# Portable laptop: no Hyprland, no external monitors.
# Everything else (shell, editors, media, theme, etc.) comes from
# m3ta-home via the profile mapping in hosts/common/users/m3tam3re.nix.
{
config,
lib,
...
}:
with lib; {
config = {
# ── 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"];
};
};
};
};
}

View File

@@ -1,34 +1,69 @@
# hosts/m3-kratos/home.nix — Host-specific home-manager overrides. # hosts/m3-kratos/home.nix — Host-specific home-manager overrides.
# AMD desktop: dual 1440p monitors. # AMD desktop: dual 2560x1440@144 via DisplayPort.
{config, lib, ...}: # 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; { with lib; {
# ── Hyprland monitor layout ── config = mkMerge [
config = mkIf config.desktop.wm.hyprland.enable { # ── XDG / MIME defaults ──
wayland.windowManager.hyprland = { {
enable = true; xdg = {
settings = { enable = true;
monitor = [ configFile."mimeapps.list".force = true;
"DP-1,2560x1440@144,0x0,1" mimeApps = {
"DP-2,2560x1440@144,2560x0,1" enable = true;
]; associations.added = {
workspace = [ "application/zip" = ["org.gnome.FileRoller.desktop"];
"1, monitor:DP-1, default:true" "application/csv" = ["calc.desktop"];
"2, monitor:DP-1" "application/pdf" = ["vivaldi-stable.desktop"];
"3, monitor:DP-1" "x-scheme-handler/http" = ["vivaldi-stable.desktop"];
"4, monitor:DP-2" "x-scheme-handler/https" = ["vivaldi-stable.desktop"];
"5, monitor:DP-2" };
"6, monitor:DP-2" defaultApplications = {
"7, monitor:DP-2" "application/zip" = ["org.gnome.FileRoller.desktop"];
]; "application/csv" = ["calc.desktop"];
windowrule = [ "application/pdf" = ["vivaldi-stable.desktop"];
"match:class dev.zed.Zed, workspace 1" "application/md" = ["dev.zed.Zed.desktop"];
"match:class Msty, workspace 1" "application/text" = ["dev.zed.Zed.desktop"];
"match:class ^(com.obsproject.Studio)$, workspace 2" "x-scheme-handler/http" = ["vivaldi-stable.desktop"];
"match:class ^(brave-browser)$, workspace 4, opacity 1.0" "x-scheme-handler/https" = ["vivaldi-stable.desktop"];
"match:class ^(vivaldi-stable)$, workspace 4, opacity 1.0" };
"match:class ^steam_app_\\d+$, idle_inhibit focus" };
];
}; };
}; }
};
# ── Hyprland monitor layout ──
(mkIf config.desktop.wm.hyprland.enable {
wayland.windowManager.hyprland = {
enable = true;
settings = {
monitor = [
"DP-1,2560x1440@144,0x0,1"
"DP-2,2560x1440@144,2560x0,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"
];
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+$, idle_inhibit focus"
];
};
};
})
];
} }