refactor: collapse fakewallet/regtest wrappers into single dev CLI
Replaces the two parallel scripts (fakewallet.sh, regtest.sh) with one
modules/dev-env/scripts/dev.sh — `dev up [--fakewallet|--regtest]`,
plus `down|logs|shell`. Default mode is fakewallet (no docker, no
chains, instant), matching what the prior scaffold did with two scripts
but giving consumers one command and one verb-set to learn.
Drops the now-redundant `lnbits.backend` enum and `features.fakewallet`
option from core.nix. Backend selection is the dev CLI's runtime
concern; a NixOS-level option would be a second knob that can disagree
with the CLI flag at runtime. `lnbits.{host,port}` stay (bind addr,
useful to docs and any later service path). `features.regtest` stays
(gates docker engine installation — consumers who'll never use the
regtest mode shouldn't pay for the container engine).
Strips modules/lnbits.nix entirely. The dev CLI runs lnbits ad-hoc; if
a NixOS-managed lnbits service becomes a real ask later, re-add a
focused module then.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
bbaa80d8a3
commit
94a7c5f97c
7 changed files with 66 additions and 157 deletions
|
|
@ -49,37 +49,20 @@ in
|
|||
|
||||
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
|
||||
+ bitcoind + electrs). Implies a container engine — install
|
||||
docker only if you actually plan to invoke `dev up --regtest`.
|
||||
The default `dev up` (FakeWallet) needs none of this
|
||||
'';
|
||||
};
|
||||
|
||||
# --- LNbits service config ---
|
||||
# --- LNbits bind addr ---
|
||||
#
|
||||
# Backend selection lives in the `dev` CLI (--fakewallet | --regtest),
|
||||
# not as a NixOS option: the dev-env scaffold doesn't manage a
|
||||
# systemd lnbits service, and we don't want two knobs (build-time
|
||||
# vs runtime) that can disagree.
|
||||
|
||||
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;
|
||||
|
|
|
|||
Reference in a new issue