feat(flake): expose nixosModules.omnixy core aggregate

Extract the reusable core module list into modules/default.nix (single
source of truth) and expose it as nixosModules.omnixy / .default.
configuration.nix now imports ./modules instead of listing each module,
so this repo's hosts and external consumers share one definition. Theme
stays a settings.theme-driven import inside the aggregate. Packs,
dev-env, sops and home-manager remain injected by mkSystem.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Padreug 2026-06-28 10:22:37 +02:00
commit 1e2677c543
3 changed files with 68 additions and 22 deletions

View file

@ -15,28 +15,14 @@ let
in
{
imports = [
# NOTE: hardware-configuration.nix is imported per-host from
# hosts/<name>/default.nix (it's machine-specific), not here.
# Omnixient modules
./modules/lib.nix
./modules/core.nix
./modules/colors.nix
./modules/boot.nix
./modules/security.nix
./modules/secrets.nix
./modules/fastfetch.nix
./modules/walker.nix
./modules/scripts.nix
./modules/menus.nix
./modules/desktop/hyprland.nix
./modules/packages.nix
./modules/development.nix
./modules/mcp.nix
./modules/themes/${currentTheme}.nix
./modules/users.nix
./modules/services.nix
./modules/hardware
# Omnixient core module aggregate (modules/default.nix) — the same set
# exposed as nixosModules.omni for external consumers, so there's a
# single source of truth for the core module list. The active theme
# is selected inside it from settings.theme.
#
# hardware-configuration.nix is imported per-host from
# hosts/<name>/default.nix (machine-specific), not here.
./modules
];
# --- Per-host settings (edit these) ---

View file

@ -311,6 +311,18 @@
# / bitcoin packs are standalone-importable — usable on a non-omni
# NixOS without enabling omni core.
nixosModules = {
# Omnixient core, as a single importable module. A consumer using
# this flake as an input builds a host with:
# omni.lib.mkSystem "myhost" {
# settings = { ... };
# modules = [ omni.nixosModules.omni ./hosts/myhost ];
# };
# mkSystem also injects packs + home-manager; this provides the
# desktop/system core (option namespace + behavior). Theme is
# chosen from settings.theme.
omni = import ./modules;
default = import ./modules;
lnbits = import ./modules/packs/lnbits.nix;
aiolabs = import ./modules/packs/aiolabs.nix;
bitcoin = import ./modules/packs/bitcoin.nix;

48
modules/default.nix Normal file
View file

@ -0,0 +1,48 @@
# Omnixient core module aggregate.
#
# The reusable Omnixient module set as a single importable module, used from
# one source of truth in two places:
# - configuration.nix imports it for this repo's own hosts;
# - it's exposed as `nixosModules.omni` (flake.nix) so an external
# consumer can `imports = [ omni.nixosModules.omni ]` from their
# own flake without forking.
#
# Deliberately NOT here:
# - modules/packs and modules/dev-env — injected separately by
# lib/mksystem.nix (packs unconditionally, dev-env opt-in);
# - hardware-configuration.nix — per-host;
# - the sops-nix / home-manager modules — injected by mkSystem.
#
# The active theme is selected from `settings.theme` (a specialArg
# provided by mkSystem), matching the prior configuration.nix behavior.
{
imports = [
./lib.nix
./core.nix
./colors.nix
./boot.nix
./security.nix
./secrets.nix
./fastfetch.nix
./walker.nix
./scripts.nix
./menus.nix
./desktop/hyprland.nix
./packages.nix
./development.nix
./mcp.nix
./users.nix
./services.nix
./hardware
# Theme: import the colorscheme module named by settings.theme. Kept
# as a settings-driven dynamic import (rather than importing all 12
# and guarding each) so the closure stays minimal.
(
{ settings, ... }:
{
imports = [ ./themes/${settings.theme}.nix ];
}
)
];
}