chore: stub option schema + lib + lnbits service wrapper
core.nix defines the lnbits-sensei.* options (user, host, features, backend). lib.nix reserves the config.lnbits-sensei.lib helper namespace with placeholder stubs. lnbits.nix is a no-op stub that documents the intended services.lnbits wrap shape and the FakeWallet default. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
3f528623b3
commit
8cc59b3024
3 changed files with 203 additions and 0 deletions
58
modules/lib.nix
Normal file
58
modules/lib.nix
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
# lnbits-sensei — shared helper functions.
|
||||
#
|
||||
# Exposed via `config.lnbits-sensei.lib` so every module can access
|
||||
# helpers without `import ./lib.nix` cycles. Mirrors omnixy's
|
||||
# modules/lib.nix pattern — this is the only place helpers are defined.
|
||||
#
|
||||
# Skeleton-only: placeholders showing the intended shape. Real
|
||||
# implementations land alongside the first module that needs them.
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
inherit (lib) mkOption types;
|
||||
cfg = config.lnbits-sensei;
|
||||
|
||||
helpers = {
|
||||
# Feature flag predicate.
|
||||
# isEnabled = feature: cfg.features.${feature} or false;
|
||||
isEnabled = _feature: false;
|
||||
|
||||
# Resolve a path under the primary user's home dir.
|
||||
# userPath = path: "/home/${cfg.user}/${path}";
|
||||
userPath = _path: throw "lnbits-sensei.lib.userPath: not yet implemented";
|
||||
|
||||
# Wrap a body in `mkIf (isEnabled feature)`.
|
||||
# withFeature = feature: body: lib.mkIf (helpers.isEnabled feature) body;
|
||||
withFeature = _feature: _body: throw "lnbits-sensei.lib.withFeature: not yet implemented";
|
||||
|
||||
# `pkgs.writeShellScriptBin` with our house preamble (set -euo
|
||||
# pipefail, shebang via /usr/bin/env bash for NixOS).
|
||||
# makeScript = name: description: body: pkgs.writeShellScriptBin name ''…'';
|
||||
makeScript =
|
||||
_name: _description: _body: throw "lnbits-sensei.lib.makeScript: not yet implemented";
|
||||
|
||||
# Standard on-disk locations the modules agree on.
|
||||
paths = {
|
||||
# config = "/etc/nixos";
|
||||
# state = "/var/lib/lnbits-sensei";
|
||||
# logs = "/var/log/lnbits-sensei";
|
||||
};
|
||||
};
|
||||
|
||||
in
|
||||
{
|
||||
options.lnbits-sensei.lib = mkOption {
|
||||
type = types.attrs;
|
||||
internal = true;
|
||||
description = "lnbits-sensei shared helpers (internal — see modules/lib.nix).";
|
||||
};
|
||||
|
||||
config = {
|
||||
lnbits-sensei.lib = helpers;
|
||||
};
|
||||
}
|
||||
Reference in a new issue