46 lines
2.4 KiB
Markdown
46 lines
2.4 KiB
Markdown
# modules/packs
|
|
|
|
Opt-in **packs** — bundles of (packages + services + config) toggled with
|
|
`omni.packs.<name>.enable`. This is the "core + goodies" layer: core is
|
|
always on; packs are off until you ask for them.
|
|
|
|
Full guide (enabling, standalone import, authoring, bitcoin specifics,
|
|
verification): **[`docs/packs.md`](../../docs/packs.md)**.
|
|
|
|
## Pattern
|
|
|
|
Each pack is one self-contained module, **always imported but inert** until
|
|
enabled (hlissner-style enable-gate):
|
|
|
|
```nix
|
|
{ config, lib, pkgs, ... }:
|
|
let cfg = config.omni.packs.media; in {
|
|
options.omni.packs.media.enable = lib.mkEnableOption "Media pack";
|
|
config = lib.mkIf cfg.enable { environment.systemPackages = with pkgs; [ … ]; };
|
|
}
|
|
```
|
|
|
|
## Files
|
|
|
|
| File | Purpose |
|
|
|---|---|
|
|
| `default.nix` | Aggregator — imports every pack + `compat.nix`. Wired into the build once, via `lib/mksystem.nix`. The ISO bypasses mksystem, so it stays pack-free. |
|
|
| `compat.nix` | Back-compat bridge: maps legacy `omni.features.*` → `omni.packs.*.enable` (mkDefault). Aggregator-only, so standalone imports don't pull in `omni.features`. |
|
|
| `media.nix`, `development.nix`, `gaming.nix`, `office.nix`, `containers.nix` | Desktop-bundle packs (migrated from `packages.nix` categories + the feature-gated bits of `core.nix`/`development.nix`). Omnixient-coupled (use `omni.lib.filterPackages`). |
|
|
| `lnbits.nix` | Wraps `../dev-env` and enables it. **Standalone-importable** (dev-env is decoupled from `omni.*`). |
|
|
| `aiolabs.nix` | Imports the gated aiolabs preset (`../dev-env/presets/aiolabs.nix`) and pulls in `lnbits`. **Standalone-importable.** |
|
|
| `bitcoin.nix` | nix-bitcoin node (bitcoind + clightning). **NOT in the aggregator** — nix-bitcoin's module asserts on import even when disabled; exposed as `nixosModules.bitcoin` for explicit per-host import. |
|
|
|
|
## Exposed as flake outputs
|
|
|
|
`flake.nixosModules.{media,development,gaming,office,containers,lnbits,
|
|
aiolabs,bitcoin}` — reusable across a second host (`gizmo`) and third
|
|
parties. `lnbits`/`aiolabs`/`bitcoin` work on a non-Omnixient NixOS.
|
|
|
|
## Adding a pack
|
|
|
|
See [`docs/packs.md` → Authoring a new pack](../../docs/packs.md#authoring-a-new-pack).
|
|
In short: copy the template, register in `default.nix` (unless it has
|
|
import-time side effects), expose in `flake.nix`, keep it
|
|
`config.omni.<core>`-free if it should be standalone, and verify the
|
|
omni closure is unchanged with `nix store diff-closures`.
|