feat: integrate m3ta-home for centralized user profiles
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
nixpkgs-9e58ed7.url = "github:nixos/nixpkgs/9e58ed7ba759d81c98f033b7f5eba21ca68f53b0";
|
||||
nixpkgs-master.url = "github:nixos/nixpkgs/master";
|
||||
|
||||
m3ta-nixpkgs.url = "git+https://code.m3ta.dev/m3tam3re/nixpkgs";
|
||||
m3ta-nixpkgs.url = "git+ssh://gitea@code.m3ta.dev/m3tam3re/nixpkgs";
|
||||
llm-agents.url = "github:numtide/llm-agents.nix";
|
||||
|
||||
#
|
||||
@@ -43,9 +43,14 @@
|
||||
rose-pine-hyprcursor.url = "github:ndom91/rose-pine-hyprcursor";
|
||||
nix-colors.url = "github:misterio77/nix-colors";
|
||||
|
||||
m3ta-home = {
|
||||
url = "git+ssh://gitea@code.m3ta.dev/m3tam3re/m3ta-home";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
agents = {
|
||||
# url = "path:/home/m3tam3re/p/AI/AGENTS";
|
||||
url = "git+https://code.m3ta.dev/m3tam3re/AGENTS";
|
||||
url = "git+ssh://gitea@code.m3ta.dev/m3tam3re/AGENTS";
|
||||
};
|
||||
## Skills
|
||||
skills-basecamp = {
|
||||
|
||||
@@ -1,11 +1,57 @@
|
||||
# hosts/common/users/m3tam3re.nix — Central user definition with m3ta-home integration.
|
||||
#
|
||||
# This module:
|
||||
# 1. Creates the m3tam3re NixOS user
|
||||
# 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)
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}: {
|
||||
}: let
|
||||
hostname = config.networking.hostName;
|
||||
|
||||
# ── 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/<hostname>/home.nix if needed.
|
||||
hostProfiles = {
|
||||
m3-ares = {
|
||||
context = "desktop";
|
||||
sets = ["coding" "gaming" "media"];
|
||||
};
|
||||
m3-kratos = {
|
||||
context = "desktop";
|
||||
sets = ["coding" "gaming" "media"];
|
||||
};
|
||||
m3-atlas = {
|
||||
context = "server";
|
||||
sets = ["coding"];
|
||||
};
|
||||
m3-helios = {
|
||||
context = "server";
|
||||
sets = [];
|
||||
};
|
||||
m3-hermes = {
|
||||
context = "server";
|
||||
sets = [];
|
||||
};
|
||||
m3-aether = {
|
||||
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;
|
||||
in {
|
||||
# ── NixOS user definition ──
|
||||
users.users.m3tam3re = {
|
||||
#initialHashedPassword = "$y$j9T$IoChbWGYRh.rKfmm0G86X0$bYgsWqDRkvX.EBzJTX.Z0RsTlwspADpvEF3QErNyCMC";
|
||||
password = "12345";
|
||||
isNormalUser = true;
|
||||
description = "m3tam3re";
|
||||
@@ -29,6 +75,119 @@
|
||||
];
|
||||
packages = [inputs.home-manager.packages.${pkgs.stdenv.hostPlatform.system}.default];
|
||||
};
|
||||
home-manager.users.m3tam3re =
|
||||
import ../../../home/m3tam3re/${config.networking.hostName}.nix;
|
||||
|
||||
# ── Home-Manager configuration via m3ta-home ──
|
||||
home-manager.users.m3tam3re = {
|
||||
imports =
|
||||
[
|
||||
# Load m3ta-home composition engine
|
||||
(m3ta-lib.mkHome {
|
||||
user = "m3tam3re";
|
||||
identity = "private";
|
||||
inherit (profile) context sets;
|
||||
})
|
||||
]
|
||||
# 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)
|
||||
++ (
|
||||
if hostHomeExists
|
||||
then [hostHomeFile]
|
||||
else []
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
36
hosts/m3-ares/home.nix
Normal file
36
hosts/m3-ares/home.nix
Normal file
@@ -0,0 +1,36 @@
|
||||
# hosts/m3-ares/home.nix — Host-specific home-manager overrides.
|
||||
# TUXEDO laptop: internal display + HDMI monitor.
|
||||
{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"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
34
hosts/m3-kratos/home.nix
Normal file
34
hosts/m3-kratos/home.nix
Normal file
@@ -0,0 +1,34 @@
|
||||
# hosts/m3-kratos/home.nix — Host-specific home-manager overrides.
|
||||
# AMD desktop: dual 1440p monitors.
|
||||
{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"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user