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:
Padreug 2026-05-24 22:34:53 +02:00
commit 8cc59b3024
3 changed files with 203 additions and 0 deletions

103
modules/core.nix Normal file
View file

@ -0,0 +1,103 @@
# lnbits-sensei — option schema.
#
# All host configuration is expressed through `config.lnbits-sensei.*`
# options defined here. Modules consume these via `lib.mkIf` / option
# reads; they never read raw `settings` outside the configuration.nix
# wire-up. This indirection lets multiple hosts share modules and lets
# the dev-env / lnbits modules toggle behaviour on feature flags
# without coupling to file layout.
{
config,
lib,
...
}:
let
inherit (lib) mkEnableOption mkOption types;
in
{
options.lnbits-sensei = {
enable = mkEnableOption "lnbits-sensei NixOS scaffold";
# --- Identity ---
user = mkOption {
type = types.str;
default = "user";
description = "Primary user on this host. Sourced from settings.nix.";
example = "alice";
};
hostName = mkOption {
type = types.str;
default = "lnbits-sensei";
description = "NixOS hostname. Sourced from settings.nix.";
};
# --- Feature flags ---
#
# Mirror the omnixy pattern: simple on/off switches gating both
# system packages and home-manager packages. Default off so a
# fresh checkout builds a minimal host until the consumer opts in.
features = {
coding = mkEnableOption ''
Development tooling for working on LNbits itself (python, poetry,
nodejs, pre-commit). Off by default flip on if this host is
your LNbits dev box rather than a runner
'';
regtest = mkEnableOption ''
Full Bitcoin/Lightning regtest docker stack (LND + CLN + Eclair
+ bitcoind + electrs). Implies a container engine. See
modules/dev-env/regtest.nix and modules/dev-env/scripts/regtest.sh
'';
fakewallet = mkEnableOption ''
FakeWallet dev mode no docker, no chains, nothing to start.
Default LNbits backend; this flag mostly controls dev-env
helpers and symmetry with the regtest workflow
'';
};
# --- LNbits service config ---
lnbits = {
backend = mkOption {
type = types.enum [
"FakeWallet"
"LndRestWallet"
"CoreLightningWallet"
"EclairWallet"
];
default = "FakeWallet";
description = ''
Which Lightning backend LNbits talks to. FakeWallet is the
default no real chain, no docker, nothing to start. The
regtest dev mode (modules/dev-env/regtest.nix) flips this to
LndRestWallet or CoreLightningWallet at activation time.
'';
example = "LndRestWallet";
};
port = mkOption {
type = types.port;
default = 5000;
description = "TCP port LNbits binds to.";
};
host = mkOption {
type = types.str;
default = "127.0.0.1";
description = ''
Bind address. Defaults to loopback; put a reverse proxy in
front for any host reachable from outside localhost.
'';
};
};
};
# No config body here — configuration.nix and the per-feature modules
# consume these options. This file is options-only on purpose so the
# schema is greppable in one place.
}