chore: remove features.old archive and format all files
- Delete home/features.old/ (archived old flat feature modules) - All content migrated to new profile-based structure - Run alejandra formatter over 13 changed files - nix flake check passes cleanly
This commit is contained in:
@@ -8,9 +8,7 @@
|
||||
# (homeLib.mkHomeConfig { profiles = ["coding" "gaming"]; context = "desktop"; })
|
||||
# ];
|
||||
# }
|
||||
{ lib }:
|
||||
|
||||
let
|
||||
{lib}: let
|
||||
# Infrastructure layer — nixpkgs overlays, nix-colors, m3ta-nixpkgs modules.
|
||||
# Always loaded on every host.
|
||||
commonModule = ../common;
|
||||
@@ -31,7 +29,6 @@ let
|
||||
gaming = ../profiles/gaming;
|
||||
media = ../profiles/media;
|
||||
};
|
||||
|
||||
in {
|
||||
# Generate a home-manager module with imports based on profiles and context.
|
||||
#
|
||||
@@ -46,36 +43,41 @@ in {
|
||||
mkHomeConfig = {
|
||||
profiles ? [],
|
||||
context ? null,
|
||||
}:
|
||||
let
|
||||
}: let
|
||||
contextImport =
|
||||
if context == "desktop" then [ contextModuleMap.desktop ]
|
||||
else if context == "server" then [ contextModuleMap.server ]
|
||||
if context == "desktop"
|
||||
then [contextModuleMap.desktop]
|
||||
else if context == "server"
|
||||
then [contextModuleMap.server]
|
||||
else [];
|
||||
|
||||
# Partition profiles into known and unknown for assertion + safe import.
|
||||
unknownProfiles = builtins.filter
|
||||
unknownProfiles =
|
||||
builtins.filter
|
||||
(profileName: ! builtins.hasAttr profileName profileModuleMap)
|
||||
profiles;
|
||||
|
||||
# Only import known profiles; the assertion below catches unknowns.
|
||||
activeProfiles = builtins.filter
|
||||
activeProfiles =
|
||||
builtins.filter
|
||||
(profileName: builtins.hasAttr profileName profileModuleMap)
|
||||
profiles;
|
||||
|
||||
profileImports = map (profileName: profileModuleMap.${profileName}) activeProfiles;
|
||||
|
||||
contextStr = if context == null then "null" else context;
|
||||
|
||||
contextStr =
|
||||
if context == null
|
||||
then "null"
|
||||
else context;
|
||||
in {
|
||||
imports =
|
||||
[ commonModule baseModule ]
|
||||
[commonModule baseModule]
|
||||
++ contextImport
|
||||
++ profileImports;
|
||||
|
||||
assertions = [
|
||||
{
|
||||
assertion = builtins.elem context [ "desktop" "server" null ];
|
||||
assertion = builtins.elem context ["desktop" "server" null];
|
||||
message =
|
||||
"m3ta home: context must be 'desktop', 'server', or null"
|
||||
+ " (got: '${contextStr}')";
|
||||
|
||||
Reference in New Issue
Block a user