omnixient/modules/packs/bitcoin.nix
Padreug 2d7c936d80 feat(packs): bitcoin, lnbits and aiolabs lightning packs
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-28 09:59:05 +02:00

46 lines
1.6 KiB
Nix

# 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;
};
}