omnixient/modules/packs/compat.nix
2026-06-28 09:59:04 +02:00

25 lines
1.1 KiB
Nix

# Back-compat bridge — maps the legacy omni.features.* booleans onto the
# new omni.packs.*.enable toggles via mkDefault, so existing hosts and
# the `preset` enum keep working unchanged through (and after) the
# migration. A host can still override any omni.packs.<name>.enable
# explicitly because these are mkDefault.
#
# Lives in the packs aggregator (modules/packs/default.nix), which is only
# loaded as part of a full omni system via lib/mksystem.nix — so a
# standalone consumer importing a single pack module (e.g.
# nixosModules.lnbits) never pulls in this omni.features dependency.
{ config, lib, ... }:
let
cfg = config.omni;
in
{
config = lib.mkIf (cfg.enable or false) {
omni.packs = {
media.enable = lib.mkDefault (cfg.features.media or false);
gaming.enable = lib.mkDefault (cfg.features.gaming or false);
office.enable = lib.mkDefault ((cfg.features.office or false) || (cfg.features.communication or false));
containers.enable = lib.mkDefault (cfg.features.containers or false);
development.enable = lib.mkDefault (cfg.features.coding or false);
};
};
}