feat(packs): bitcoin, lnbits and aiolabs lightning packs

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Padreug 2026-06-28 06:48:37 +02:00
commit 2d7c936d80
3 changed files with 85 additions and 0 deletions

46
modules/packs/bitcoin.nix Normal file
View file

@ -0,0 +1,46 @@
# bitcoin pack — a real Bitcoin/Lightning node via nix-bitcoin.
#
# STANDALONE-IMPORTABLE and DISABLED BY DEFAULT. Imports only
# nix-bitcoin.nixosModules.default (NOT the secure-node/hardened presets,
# which are server-oriented and hostile to a desktop). When enabled it
# runs bitcoind + clightning with auto-generated secrets and grants the
# operator account CLI access.
#
# Note: nix-bitcoin's default module replaces nixpkgs' services.bitcoind
# and claims that namespace (disabledModules). omni sets no
# services.bitcoind config, so importing it inert is closure-neutral.
{ config, lib, inputs, ... }:
let
cfg = config.omni.packs.bitcoin;
in
{
imports = [ inputs.nix-bitcoin.nixosModules.default ];
options.omni.packs.bitcoin = {
enable = lib.mkEnableOption "Bitcoin/Lightning node via nix-bitcoin (bitcoind + clightning)";
operatorName = lib.mkOption {
type = lib.types.str;
default = "operator";
description = ''
Operator account granted CLI access to the node. Set to your login
user. Kept omni-independent (a plain default, not
config.omni.user) so this pack stays standalone-importable.
'';
};
};
config = lib.mkIf cfg.enable {
# generateSecrets auto-writes node secrets at activation (never during
# build/VM, so it can't affect the build-only gates). Simplest secrets
# path for a workstation; sops integration is a future option.
nix-bitcoin.generateSecrets = true;
nix-bitcoin.operator = {
enable = true;
name = cfg.operatorName;
};
services.bitcoind.enable = true;
services.clightning.enable = true;
};
}