feat(packs): opt-in package packs — media/office/dev/gaming/containers/compat
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
e0f2a3951f
commit
095f2ccf29
8 changed files with 449 additions and 0 deletions
25
modules/packs/compat.nix
Normal file
25
modules/packs/compat.nix
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
# 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);
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue