diff --git a/hosts/common/users/m3tam3re.nix b/hosts/common/users/m3tam3re.nix index 7f98d68..6e8c354 100644 --- a/hosts/common/users/m3tam3re.nix +++ b/hosts/common/users/m3tam3re.nix @@ -5,6 +5,11 @@ # 2. Loads the m3ta-home profile system via mkHome # 3. Sets per-host feature flags based on a host profile mapping # 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//home.nix if the host needs overrides (monitors, etc.) { config, pkgs, @@ -15,8 +20,8 @@ # ── Per-host profile mapping ── # Determines which m3ta-home context and sets each host gets. - # To add a new host: add an entry here + create hosts//home.nix if needed. hostProfiles = { + # ── Desktop hosts ── m3-ares = { context = "desktop"; sets = ["coding" "gaming" "media"]; @@ -25,6 +30,11 @@ context = "desktop"; sets = ["coding" "gaming" "media"]; }; + m3-daedalus = { + context = "desktop"; + sets = ["coding" "media"]; + }; + # ── Server hosts ── m3-atlas = { context = "server"; 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; # Check if a per-host home.nix exists hostHomeFile = ./../../${hostname}/home.nix; 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 { # ── NixOS user definition ── users.users.m3tam3re = { @@ -86,104 +240,10 @@ in { identity = "private"; inherit (profile) context sets; }) + # Per-host feature flags + hostFlags ] - # Per-host feature flag 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) + # Per-host home.nix (Hyprland monitors, XDG/MIME, HW-specific overrides) ++ ( if hostHomeExists then [hostHomeFile] diff --git a/hosts/m3-ares/home.nix b/hosts/m3-ares/home.nix index be9df47..9bac583 100644 --- a/hosts/m3-ares/home.nix +++ b/hosts/m3-ares/home.nix @@ -1,36 +1,71 @@ # hosts/m3-ares/home.nix — Host-specific home-manager overrides. -# TUXEDO laptop: internal display + HDMI monitor. -{config, lib, ...}: +# TUXEDO laptop: eDP-1 + HDMI-A-1 external monitor. +# 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; { - # ── Hyprland monitor layout ── - config = 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" - ]; + 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.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" + ]; + }; + }; + }) + ]; } diff --git a/hosts/m3-daedalus/home.nix b/hosts/m3-daedalus/home.nix new file mode 100644 index 0000000..22d84bb --- /dev/null +++ b/hosts/m3-daedalus/home.nix @@ -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"]; + }; + }; + }; + }; +} diff --git a/hosts/m3-kratos/home.nix b/hosts/m3-kratos/home.nix index d1acabb..d4f59a9 100644 --- a/hosts/m3-kratos/home.nix +++ b/hosts/m3-kratos/home.nix @@ -1,34 +1,69 @@ # hosts/m3-kratos/home.nix — Host-specific home-manager overrides. -# AMD desktop: dual 1440p monitors. -{config, lib, ...}: +# 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; { - # ── Hyprland monitor layout ── - config = 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" - ]; + 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.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" + ]; + }; + }; + }) + ]; }