diff --git a/modules/packs/aiolabs.nix b/modules/packs/aiolabs.nix new file mode 100644 index 0000000..97d4327 --- /dev/null +++ b/modules/packs/aiolabs.nix @@ -0,0 +1,14 @@ +# aiolabs pack — the opinionated aiolabs project list + deploy targets + +# tmux sessions, layered on the lnbits dev environment. +# +# Imports the aiolabs preset, which is gated on omni.packs.aiolabs.enable +# (inert until enabled) and pulls in the lnbits pack. The project/deploy/ +# tmux definitions live in the preset; this file declares the toggle and +# wires it in. +{ lib, ... }: +{ + imports = [ ../dev-env/presets/aiolabs.nix ]; + + options.omni.packs.aiolabs.enable = + lib.mkEnableOption "aiolabs project preset (projects, deploy targets, tmux) on top of lnbits"; +} diff --git a/modules/packs/bitcoin.nix b/modules/packs/bitcoin.nix new file mode 100644 index 0000000..b0c6b35 --- /dev/null +++ b/modules/packs/bitcoin.nix @@ -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; + }; +} diff --git a/modules/packs/lnbits.nix b/modules/packs/lnbits.nix new file mode 100644 index 0000000..96021d0 --- /dev/null +++ b/modules/packs/lnbits.nix @@ -0,0 +1,25 @@ +# lnbits pack — the LNbits multi-project dev environment. +# +# STANDALONE-IMPORTABLE: imports the dev-env module and enables it, so a +# third party importing only `nixosModules.lnbits` onto their own NixOS +# gets the full dev environment (worktrees, regtest, tmux, pre-commit +# hook) without needing omni core. dev-env was decoupled from omni.* +# in an earlier commit precisely to make this possible. (This is what lets +# the standalone lnbits-sensei scaffold be retired — see P8.) +# +# Configure the environment via the standard dev-env.* options +# (dev-env.user, dev-env.root, dev-env.projects, …). +{ config, lib, ... }: +let + cfg = config.omni.packs.lnbits; +in +{ + imports = [ ../dev-env ]; + + options.omni.packs.lnbits.enable = + lib.mkEnableOption "LNbits dev-environment pack (worktrees, regtest, tmux)"; + + config = lib.mkIf cfg.enable { + dev-env.enable = lib.mkDefault true; + }; +}