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>
58 lines
1.7 KiB
Nix
58 lines
1.7 KiB
Nix
# 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;
|
|
};
|
|
}
|