Repository navigation
Unify Bitcoinix Packages on Unstable Nixpkgs - #224
Conversation
564689d to
eb3db02
Compare
|
@viberaven Heads-up: I am retesting the parts CI doesn't cover locally, on the current head. A full review with results will follow.
We can't test the container examples, the test-runner container or the memlock flag here (they need root). @ostermayer This PR moves the whole package and OS base from NixOS 26.05 to unstable, so it's a big one. Would you mind running it through your AI review setup when you have a moment? Thanks! |
eb3db02 to
ab53af9
Compare
ab53af9 to
f0cae02
Compare
|
Thanks for the changes! Changes requested: the I2P change exposes more than before, and the migration docs don't match what happens on a NixOS 26.05 system. Must fix
Should fix
Optional
Tested Review performed with Claude Code (Claude Opus 5.5). |
f0cae02 to
8ade3ca
Compare
|
@seberm Addressed the review and force-pushed the updated branch, now at
Validation on the updated local branch: Assisted by Codex (gpt-6.1-sol). |
8ade3ca to
b290eb8
Compare
|
@prusnak I think we should release the v0.1.5 before merging this one. Let's target this for v0.1.6 - agree? btw - running another round of review. |
|
The previous round's points (I2P listeners, migration docs, channel choice, trustedcoin upstream link, memlock wording) are all addressed. A treewide recheck and a full-node diff against master (every service, netns, i2p, hardened-extended) found the following. Must fix
Should fix
Optional
Tested Assisted-by: Claude Code (Claude Opus 5.5) |
Yes. This PR is definitely post-0.1.5 |
b290eb8 to
c5612f5
Compare
|
Rebased onto current Since 0.1.5 has now been released, moved this PR's unstable-only and nspawn migration notices to 0.1.6, preserved the released 0.1.5 notes, updated the main example's configVersion, and adjusted the migration checks. Validation passed on the new pin: all-system flake evaluation; all four x86_64 flake check builds; Assisted by Codex (gpt-6.1-sol). |
|
Fixed the The pinned nixpkgs electrs 0.12.0 derivation lacks Local validation passed:
Assisted by Codex (gpt-6.1-sol). |
fixed in NixOS/nixpkgs#585046 let's wait until the fix hits nixos-unstable - see https://pr.bitcoinix.net/?pr=585046 - and then rebase dropping the patch |
55f0eb4 to
d624be9
Compare
|
Rebased onto current master ( For #245, preserved the switch to nixpkgs RTL, TrustedCoin, Trezor, and Lightning Python packages. The removed local derivations stay removed. The Python package set now uses the single unstable Kept clnrest's package-only rename in release notes and its config-version notice/test removed. Updated the new package release notes and developer guidance for the single input, and linked the 0.1.6 system migration from the release notes. Regenerated with Validation passed: Assisted by Codex (gpt-6-astra). |
|
Simplified package selection and aligned this PR with its existing
Validation: all 14 pinned and 19 module package derivation paths match the previous head on both x86_64-linux and aarch64-linux. The refresh helper leaves the lock file and version metadata unchanged. Assisted by Codex (gpt-6-astra). |
ostermayer
left a comment
There was a problem hiding this comment.
I ran this through Fable 5.2 (xhigh), GPT-6 Astra (max), Kimi K3.1 Pro (max, two passes), DeepSeek V4.1 Flash 1017 (max) and GLM 5.3 (max). Astra and K3.1 found nothing. I checked the other findings against the code, and these five hold up.
-
The packages master takes from the separately locked unstable input (
btcpayserver clboss clightning electrs fulcrum lnd lndinit nbxplorer rtl trustedcoininpkgs/pinned.nix) now come from the onepkgs. So they follow the system's own nixpkgs in three setups:- Non-flake imports.
modules/nix-bitcoin.nixpasses the systempkgstopkgs/default.nix, anduseVersionLockedPkgsisn't declared there. On master thepkgsUnstabledefault inpkgs/default.nixstill locked these packages. nix-bitcoin.useVersionLockedPkgs = false, which the 0.2.0 notice suggests for keeping overlays.- Flakes that set
bitcoinix.inputs.nixpkgs.follows.
A routine update of the user's nixpkgs can then move lnd or clightning to a release bitcoinix hasn't tested, or back to an older one that refuses the newer database. The 0.2.0 notice says service packages use the locked revision, but that isn't true without flakes. I'd at least say this in the notice and in
docs/upgrading.md. - Non-flake imports.
-
Systems that follow bitcoinix's
nixpkgsalso pick up unstable's new NixOS defaults, and the 0.2.0 section ofdocs/upgrading.mddoesn't name them. Two of them matter on a node.networking.firewall.checkReversePathgoes fromtrueto"loose", andprograms.fuse.enablegoes from on to off, so an operator's own non-root FUSE mounts, like an sshfs backup target, losefusermount. This PR turns FUSE on only for replication. -
examples/container/flake.nixdoesn't add--system-call-filter=@memlock, butexamples/deploy-container.shandtest/lib/make-test.nixdo. A new user who starts from that example and enables clightning gets thelightning_hsmdabort that the notice describes. -
.github/cve-whitelist.tomlasks to re-check its exceptions when nixpkgs is updated, and its header still points to the review against the old pins. This PR is that update, so the exceptions need a check against f4a03c0. -
services.i2pd.checkConfig = mkDefault falseinmodules/netns-isolation.nixturns off i2pd's build-time check for every netns node with I2P. A typo in customservices.i2pd.settingsthen shows up only at runtime. Thei2pandi2pLocalscenarios cover the generated config, but the description doesn't list them among the scenarios rerun after the rebase.
Nothing here puts funds at risk. lnd 0.21.6 and clightning 26.06.10 are the same at both pins, the i2pd settings keep the 26.05 exposure, and the trustedcoin patch matches v0.8.7.
… store (#266) Fixes #64. `bitcoin.conf` is built with `builtins.toFile`. So the `rpcauth=<name>:<salt>$<hmac>` line of every custom RPC user in `services.bitcoind.rpc.users` ends up in the world-readable Nix store. Any local user can read the salt and HMAC and test password guesses offline. A long random password is safe. A weak one isn't. The `passwordHMAC` description didn't say so, and the docs didn't cover custom RPC users at all. This PR documents the risk. It doesn't change behavior. - The `passwordHMAC` description now says that the value goes to the Nix store, and advises a long random password, like the one that Bitcoin Core's `share/rpcauth/rpcauth.py` generates when you don't pass a password. - The LAN RPC section of `docs/configuration.md` gets a short custom RPC user example with the same warning. It also covers `rpcauth` lines in `extraConfig`, which land in the store too. And it says to change a weak password, because the old HMAC stays in the store until it is garbage-collected. - A 0.2.0 release note points existing users to that section. The built-in users `privileged`, `public` and `btcpayserver` read their HMAC from the secrets dir, so they aren't affected. Keeping a custom user's HMAC out of the store is possible, with a public `passwordHMACFromFile` that declares a `bitcoin-HMAC-<name>` secret. But that's a new feature: secret generation doesn't create the file, and the docs need steps to provide it. I left it for a follow-up. ## Testing - `nix eval .#ciTestInfo`: pass - `nix build .#checks.x86_64-linux.module-config`: pass - `nix build .#checks.x86_64-linux.test-runner`: pass - `mdbook build`: pass. The new text renders, and the release note link resolves to the `allow-bitcoind-rpc-connections-from-lan` heading. - The evaluated `passwordHMAC` description shows the new text. No VM test, because nothing changes at runtime. - After the rebase onto master 0d12e6c, `module-config`, `test-runner`, `ci-workflows` and the mdBook build pass on the KVM host. ## Models Claude Opus 5.5 wrote the change. Codex GPT-5.6 Sol, Codex GPT-6 Astra (two passes), Kimi K3.1 Pro (two passes), DeepSeek V4.1 Flash 1017 and GLM 5.3 reviewed it. Claude Opus 5.5 rebased it onto #224.
…s funds (#274) Part of #87. With `services.btcpayserver.lightningBackend = "clightning"`, BTCPay Server joins the clightning group and talks to lightningd over its RPC socket `lightning-rpc`. The socket allows every method. So BTCPay Server can pay invoices (`pay`, `xpay`), withdraw on-chain funds (`withdraw`), open and close channels (`fundchannel`, `close`) and start plugins (`plugin`), which run as the clightning user. A bug in BTCPay Server, a malicious BTCPay plugin or a stolen admin session can drain the node. With `lnd`, BTCPay Server gets its own macaroon (`services.lnd.macaroons.btcpayserver`). It can read the node's state and create invoices and addresses, but it can't send funds or open or close channels. Neither the option nor the docs said this. This PR changes no behavior. It adds these docs. - The access of each backend in the `lightningBackend` option description, with a recommendation to use `lnd` when BTCPay Server should be limited. - A BTCPay Server section in `docs/services.md` with the same facts and the reason. It also says that with clnrest enabled, the clightning group can read clnrest's admin rune. - A note at the clightning backend in `examples/configuration.nix`. - A 0.2.0 release note that points to the new section, so existing users see it. The second commit adds two notes that the red-team review found. The backend limits only the Lightning node, so BTCPay Server can spend a hot wallet with either backend. And bitcoinix turns on Core Lightning for BTCPay Server only while it's the backend. So before a node with Core Lightning channels switches to `lnd`, it needs `services.clightning.enable = true` and another lnd port, or its channels closed. bitcoinix can't give BTCPay Server a restricted rune today. BTCPay Server 2.4.7 uses BTCPayServer.Lightning 1.7.14. Its Core Lightning client accepts only `type=clightning;server=unix://...` or `tcp://...` and sends raw JSON-RPC. It has no clnrest or rune support. It needs no versioning notice, since nothing changes at runtime. ## Not in this PR The fix for the access itself stays open in #87. I believe there are two ways to fix it. - A method allowlist in front of `lightning-rpc` for BTCPay Server. Receiving payments needs `invoice`, `listinvoices`, `waitanyinvoice`, `getinfo` and `delinvoice`. The Lightning node page and payouts need more, including `xpay`. - Rune support in BTCPayServer.Lightning upstream, so bitcoinix can connect BTCPay Server through clnrest with a restricted rune. ## Testing - `nix eval .#ciTestInfo` passes. - `nix build .#checks.x86_64-linux.module-config` and `.#checks.x86_64-linux.test-runner` pass. - `nix shell --inputs-from . nixpkgs#mdbook -c mdbook build` succeeds. The new section and its link to Custom macaroons render. - No VM run, because nothing changes at runtime. - After the rebase onto master 0d12e6c, `module-config`, `test-runner`, `ci-workflows` and the mdBook build pass on the KVM host. ## Models Claude Opus 5.5 wrote the change. Codex GPT-5.6 Sol, Codex GPT-6 Astra (two passes plus rechecks), Kimi K3.1 Pro (two passes), DeepSeek V4.1 Flash 1017 and GLM 5.3 reviewed it. Claude Opus 5.5 rebased it onto #224.
#268) Fixes #128. The btcpayserver user is in NBXplorer's group, because BTCPay Server reads NBXplorer's API cookie (`/var/lib/nbxplorer/<network>/.cookie`). But the secret `bitcoin-rpcpassword-btcpayserver`, NBXplorer's bitcoind RPC password, had the same group and the default mode `0440`. So BTCPay Server could read the password, although it never uses it. The secret now belongs to NBXplorer's user, with mode `0400`. Only NBXplorer reads it, in its `preStart`. bitcoind reads only `bitcoin-HMAC-btcpayserver`, which doesn't change. The group still gives BTCPay Server the cookie. `setup-secrets` and nixops apply the new owner and mode on the next deployment. A program that read the password through the group, or as the `bitcoin` user, now fails. So config version 0.2.0 gets a notice for configs with BTCPay Server, and `docs/upgrading.md` says what to do. It also says how to replace the password if BTCPay Server was compromised. Users who manage the secret files outside bitcoinix have to change this one by hand. The notice targets 0.2.0, the lowest open milestone. ## Testing The `btcpayserver` VM test now checks that the password file is `nbxplorer`-owned with mode `0400`, that the btcpayserver user can't read it, and that it can still read NBXplorer's cookie. Before this change, the first two checks fail. - `regtest`: passes. NBXplorer still connects to bitcoind, and BTCPay Server's `/api/v1/health` reports `synchronized`, so BTCPay Server still authenticates to NBXplorer with the cookie. - `default`: passes. - `ciTestInfo`, `checks.x86_64-linux.module-config` and `checks.x86_64-linux.test-runner`: pass. - Evaluation: a BTCPay Server config at config version 0.1.6 gets the notice, which names the configured NBXplorer user. On master it's a warning. A config without BTCPay Server gets no notice. - `mdbook build`: passes, and the release note links to the new upgrading section. ## Not in this PR - NBXplorer's RPC proxy (`POST /v1/cryptos/BTC/rpc`) still lets the cookie holder call the methods NBXplorer allows without `exposerpc`, for example `sendrawtransaction` and `gettxout`. This PR removes BTCPay Server's direct access to the rest of the whitelist and its copy of the credential. - NBXplorer's data dir is `0770 nbxplorer:nbxplorer`, so the btcpayserver user can write there. That could be its own issue. - After the rebase onto master c3d955c (#283), `module-config`, `test-runner`, `ci-workflows` and `regtest` pass on the KVM host. On master, the notice is a warning until 0.2.0 is released, and the tests pass with `version.nix` at 0.1.6 and at 0.2.0. ## Models Claude Opus 5.5 wrote the change. Codex GPT-5.6 Sol, Codex GPT-6 Astra (two passes), Kimi K3.1 Pro (two passes), DeepSeek V4.1 Flash 1017 and GLM 5.3 reviewed it. Claude Opus 5.5 rebased it onto #224 and #283.
…ervice (#273) Fixes #132. The `secure-node.nix` preset always publishes sshd as an onion service, but nothing in `modules/` turned off SSH password login. Only the example configs did. NixOS allows passwords by default. So a config that imports the preset into an existing setup let anyone with the onion address try passwords over Tor. This includes the operator, who is in the groups that control funds (`bitcoin`, `clightning`, `lnd`). The preset now sets `services.openssh.settings.PasswordAuthentication` and `KbdInteractiveAuthentication` to `mkDefault false`. sshd then accepts only keys, over the onion service and over the node's IP address. A config that needs passwords can still set either option to `true`. This can lock out an account that logs in with a password, so it comes with a 0.2.0 notice. It fires for every config that uses the preset and enables sshd. A narrower condition would need to tell how the config defines the two options, and every way to do that missed some affected configs. A missed notice can lock the operator out of the node, and a needless one only costs a config version bump. The notice and the upgrade notes say that nothing changes for a config that already sets both options to `false`, like the flakes and Colmena examples. Keyboard-interactive login through PAM depends on the PAM module, because NixOS sets `security.pam.services.sshd.unixAuth` from `PasswordAuthentication`. I checked sshd's PAM stack in the pinned nixpkgs: - `googleAuthenticator`: without `unixAuth`, the stack is only `pam_deny`, so such setups need both options set back to `true`. With `services.homed.enable`, NixOS adds the rule without `unixAuth`. - `otpwAuth`: with `unixAuth`, a `sufficient pam_unix` rule comes before `pam_otpw`, so a plain password would skip the one-time password. Such setups need only `KbdInteractiveAuthentication = true`. The upgrade notes say this and tell users to test a new login before they close their session. A config that sets one of the options to `true` with `lib.mkDefault` fails evaluation with "conflicting definition values", because the preset uses the same priority. This happens at any config version, before the notice shows. The upgrade notes say to set the option without `lib.mkDefault`. Docs: - `docs/upgrading.md`: a 0.2.0 entry with the check, the PAM case, the conflict error and the way back. - `docs/release-notes.md`: a 0.2.0 entry. - `docs/introduction.md` and the SSH onion service section of `docs/services.md` now say that the preset turns off SSH password login. Nothing else in the repo uses SSH password login. The tests, the QEMU and krops deployment scripts and the deployment examples all log in with keys. The preset doesn't change `PermitRootLogin`, so root keeps the NixOS default `prohibit-password`. ## Testing - `nix build .#checks.x86_64-linux.module-config` passes. Two new tests: - `testSecureNodeSshKeysOnly`: the preset gives `false` for both options, an explicit `true` wins, and without the preset both stay `true`. It fails with the preset from master. - `testVersioningSecureNodeSshPasswords`: the notice fires with the preset and sshd, not with sshd disabled, not without the preset, and not for a 0.2.0 config once 0.2.0 is released. - `nix build .#checks.x86_64-linux.test-runner` passes. - `nix eval .#ciTestInfo` passes. - `./test/run-tests.sh -s secureNode` passes. - A config with the preset and `PasswordAuthentication = lib.mkDefault true` fails with "conflicting definition values" before and after 0.2.0 is released. - After the rebase onto master c3d955c (#283), `module-config`, `test-runner`, `ci-workflows` and `secureNode` pass on the KVM host. `acknowledged` replaces `current`, because master now rejects config version 0.2.0 before the release. It checks that a config at 0.2.0 doesn't get the notice once 0.2.0 is released. On master, the notice is a warning until 0.2.0 is released, and the tests pass with `version.nix` at 0.1.6 and at 0.2.0. ## Models Claude Opus 5.5 wrote the change. Codex GPT-5.6 Sol, Codex GPT-6 Astra (two passes plus rechecks), Kimi K3.1 Pro (two passes), DeepSeek V4.1 Flash 1017 and GLM 5.3 reviewed it. Claude Opus 5.5 rebased it onto #224 and #283. Kimi K3.1 Pro (two passes) and Claude Fable 5.2 reviewed the second rebase.
Fixes #124. Two documented steps left users with a recovery file that recovers nothing. When lnd starts without a wallet, as after the first deploy, `modules/lnd.nix` creates a new wallet and writes its seed to `lnd-seed-mnemonic` in lnd's data dir. "Migrate existing services to bitcoinix" in `docs/configuration.md` copies the old data dir with `rsync -a`, which keeps that file. lnd reads the file only to create a wallet, so nothing notices that it doesn't match the migrated wallet. And `examples/configuration.nix` says to back it up as the wallet seed. With `nix-bitcoin.generateSecrets`, `services.backups` includes the secrets dir, and with it `backup-encryption-password`, the password that decrypts the backups. No copy of it exists outside the node and the backups. So when the node's disk dies, the backups can't be decrypted. This PR changes only docs and one option description: - The lnd step of the migration section says to copy `lnd-seed-mnemonic` off the node and remove it before the copy, and to keep that copy if the new wallet got funds, because the migration replaces that wallet. It says the seed of a migrated wallet is the seed of the old node. Users who migrated before get a paragraph on how to tell which seed the file holds. - The lnd backup note in `examples/configuration.nix` says that bitcoinix creates the seed file only with a new wallet, and points to the migration section. - The backups section of `examples/configuration.nix` and the description of `services.backups.enable` say to keep a copy of `backup-encryption-password` off the node. The example uses the default secrets dir and says so. - A 0.2.0 release note points users who already migrated or already run backups to these steps. There's no backups page under `docs/`, so the example config and the option description are where the backups are documented. ## Testing - `nix eval .#ciTestInfo` passes. - `nix build .#checks.x86_64-linux.module-config` passes. - `mdbook build` passes on the final head, and the built `configuration.html` has the new lnd step. - No VM test, because nothing changes at run time. - After the rebase onto master 0d12e6c, `module-config`, `test-runner`, `ci-workflows` and the mdBook build pass on the KVM host. ## Models Claude Opus 5.5 wrote the change. Codex GPT-5.6 Sol, Codex GPT-6 Astra (two passes plus rechecks), Kimi K3.1 Pro (two passes), DeepSeek V4.1 Flash 1017 and GLM 5.3 reviewed it. Claude Opus 5.5 rebased it onto #224.
Fixes #127. clightning added `getblockfrompeer` and mempool added `gettxoutsetinfo` to the whitelist of the shared `public` RPC user. `rpcwhitelist` is a list option, so the module system merged both into one list for `public`, and every service that connects as `public` got them. With mempool enabled, electrs, fulcrum and lnd could call `gettxoutsetinfo`, which walks the whole UTXO set and can keep bitcoind busy for minutes. BTCPay's user builds on the public list, so it got `gettxoutsetinfo` too. The comment in `bitcoind-rpc-public-whitelist.nix` said each module grants these methods to itself, which only btcpayserver did. This PR gives clightning and mempool their own RPC users, as btcpayserver has: - `clightning`: the public whitelist plus `getblockfrompeer` when bcli is the backend. With trustedcoin, it's the public whitelist alone. - `mempool`: the public whitelist plus `gettxoutsetinfo`. - An empty `rpcwhitelist` disables whitelisting for its user. So when the public whitelist is empty, both new whitelists stay empty too, and the services keep the unrestricted access they had through `public`. - Each user gets its own generated password and HMAC (`bitcoin-rpcpassword-<user>`, `bitcoin-HMAC-<user>`), owned like the btcpayserver ones. - clightning and mempool connect as their new users and leave the `bitcoinrpc-public` group, since they no longer read its password. - The `public` user keeps only the base whitelist. BTCPay's whitelist is now the base list plus `getblockfrompeer`, which is what nbxplorer probes for. It never needed `gettxoutsetinfo`. The pinned trustedcoin 0.8.7 reads `bitcoin-rpcuser` and `bitcoin-rpcpassword` from lightningd and calls `getblockchaininfo`, `getblockhash`, `getblock`, `getrawtransaction`, `estimatesmartfee` and `sendrawtransaction`. All of them are in the base list, so it keeps working with the `clightning` user. It still logs that password at startup (#191), but now it's the password of the clightning user, not the one that electrs, fulcrum and lnd share. The other clightning plugins don't talk to bitcoind. ## Migration A 0.2.0 notice fires for every config that enables clightning or mempool. No option marks a bitcoind on another node, since the `bitcoind-remote.nix` preset only changes the bitcoind unit. And configs that supply their own secrets have to act either way. So the text depends on the config instead. With `nix-bitcoin.generateSecrets`, it says there's nothing else to do when bitcoind runs on the node. Otherwise it says to create the new secrets first. For a bitcoind on another node, it lists the whitelists to set there. It also says to remove `getblockfrompeer` and `gettxoutsetinfo` from the remote public user if it has them, whatever the new config enables, since the old config may have added them. With BTCPay Server, it says to set the remote BTCPay user's whitelist again, since that list builds on the public one and had `gettxoutsetinfo` with mempool. The released 0.1.5 notice for mempool's RPC password told users to save the password to `bitcoin-rpcpassword-public`. Notices are evaluated against the current code, which reads `bitcoin-rpcpassword-mempool`, so it now names that file. So does the 0.1.5 section of `docs/upgrading.md`, which also says that releases before 0.2.0 read `bitcoin-rpcpassword-public`. `docs/upgrading.md` says what each setup has to do. The guide for a bitcoind on another node in `docs/configuration.md` now lists the new users, their whitelists, their password files, and the local HMAC files that setup checks. The migration tests for the currencyrate and rebalance plugins and for mempool's RPC password stay as master has them. Once 0.2.0 is released, later notices block every older config there, so a new test checks the 0.1.5 notices by their message. ## Testing - `test/configuration.nix`: new checks that `public` has neither method, `clightning` and `btcpayserver` have only `getblockfrompeer`, `mempool` has only `gettxoutsetinfo`, and `clightning` with trustedcoin has neither. With an empty public whitelist, both new whitelists are empty. Also that both services read their own password and aren't in `bitcoinrpc-public`, and what the notice says for which config, including the remote public and BTCPay whitelists. - `test/suite/security.py`, test `rpc-whitelist`: `public` can't call either method, and each service user can call only its own. Before this change, `public` could call `gettxoutsetinfo` in the `regtest` scenario. - `module-config` and `test-runner` checks pass, and the mdBook build succeeds. - `regtest` scenario passes. The bitcoind log shows `public` refused `gettxoutsetinfo` and `getblockfrompeer`, `mempool` refused `getblockfrompeer`, and `clightning` and `btcpayserver` refused `gettxoutsetinfo`. - `trustedcoin` scenario fails, as it does on master 772846d. trustedcoin logs `bitcoind RPC working` as user `clightning`, and `rpc-whitelist` passes: `clightning` is refused `getblockfrompeer` and `gettxoutsetinfo`. The failure is a startup race in trustedcoin, unrelated to this change. When clightning restarts right after bitcoind, lightningd asks for the chain tip before trustedcoin's `OnInit` has set up its bitcoind client. trustedcoin then falls back to block explorers, which the VM can't reach, returns `tip: 0`, and lightningd exits with `bitcoind has gone backwards`. The start then hangs in clightning's `postStart` until it times out. - After the rebase onto master c3d955c (#283), `module-config`, `test-runner`, `ci-workflows`, `regtest` and `trustedcoin` pass on the KVM host. `acknowledged` replaces `current`, because master now rejects config version 0.2.0 before the release. It checks that a config at 0.2.0 doesn't get the notice once 0.2.0 is released. On master, the notice is a warning until 0.2.0 is released, and the tests pass with `version.nix` at 0.1.6 and at 0.2.0. Deleting a 0.1.5 notice fails `testMigrationNotices015` with `version.nix` at 0.1.6 and at 0.2.0. ## Models Claude Opus 5.5 wrote the change. Codex GPT-5.6 Sol, Codex GPT-6 Astra (two passes plus rechecks), Kimi K3.1 Pro (two passes), DeepSeek V4.1 Flash 1017 and GLM 5.3 reviewed it. Claude Opus 5.5 rebased it onto #224 and #283. Kimi K3.1 Pro (two passes) and Claude Fable 5.2 reviewed both rebases.
Fixes #123. This is hardening of the data dir route. The RPC socket already lets every member of the clightning group run code as the clightning user, for example with `plugin start`. Taking BTCPay Server off the socket is #87. The bitcoind and lnd data dirs stay `0770`, because only the operator joins those groups. The Core Lightning data dir had mode `0770`, so every member of the clightning group could create, rename and delete entries in it. The group holds the operator user when `nix-bitcoin.operator.enable` is set, the btcpayserver user with `services.btcpayserver.lightningBackend = "clightning"`, and any user you add. A member could rename its own file over `config` after `preStart` wrote it and before lightningd read it, and make lightningd load a plugin as the clightning user. Or it could move the network dir aside and plant one with its own `hsm_secret`. Group members only need to pass through the data dir to reach the RPC socket and to read `config`, so the dir is now `0750`. The tmpfiles rule sets this mode on existing nodes at the next deployment. lightningd creates the network dir with mode `0700`, and `postStart` adds only `g+x`. So the RPC socket is the only entry under the data dir that the group can write. I checked each user of the group: BTCPay Server, `lightning-cli`, `lnconnect-clnrest`, nodeinfo, RTL's root scripts, the clnrest rune, the plugins and replication. None of them writes to the data dir as a group member. A script that writes to the data dir as a group member now fails. So config version 0.2.0 gets a notice for configs with clightning. `docs/upgrading.md` explains the change and how to list entries that a group member created. The release notes get a 0.2.0 entry. Tests: - The `clightning` test checks the data dir's owner, group and mode. It checks that the RPC socket is the only entry the group or others can write, and that every entry belongs to the clightning user. For each member of the clightning group, it checks that `lightning-cli getinfo` works and that creating a file in the data dir fails. - The new scenario `btcpayserverClightning` runs BTCPay Server on the clightning backend. It's in the CI matrix. The `btcpayserver` test checks lnd's macaroon only with the lnd backend. The Greenfield request in the `regtest` test reaches clightning through the socket. - `config-replace` plants its symlink as the clightning user, because the operator can't write the data dir anymore. - `module-config` checks which configs get the notice. ## Testing On an x86_64-linux KVM host: - `./test/run-tests.sh -s btcpayserverClightning`: pass on the final head - `./test/run-tests.sh -s regtest`, `-s default` and `-s lnconnectNoOperatorRole`: pass on the previous head. Since then only the test's quoting and member loop and the docs changed. - `nix eval .#ciTestInfo`: pass, and it lists `btcpayserverClightning` - `nix build .#checks.x86_64-linux.{module-config,test-runner,ci-workflows,lnd-macaroon-filters}`: pass - `./test/shellcheck.sh`: pass - `systemd-tmpfiles --create` with a `d <dir> 0750` rule changes an existing `0770` dir to `0750`, as on an upgraded node. I didn't run `netns` and `netnsRegtest`. CI runs them. - After the rebase onto master c3d955c (#283), `module-config`, `test-runner`, `ci-workflows`, `shellcheck` and `btcpayserverClightning` pass on the KVM host. This PR doesn't change master's plugin migration checks. On master, the notice is a warning until 0.2.0 is released, and the tests pass with `version.nix` at 0.1.6 and at 0.2.0. ## Models Claude Opus 5.5 wrote the change. Codex GPT-5.6 Sol, Codex GPT-6 Astra (two passes plus a recheck), Kimi K3.1 Pro (two passes), DeepSeek V4.1 Flash 1017 and GLM 5.3 reviewed it. Claude Opus 5.5 rebased it onto #224 and #283.
…278) Fixes #131. BTCPay Server makes the first account that registers the server admin. That account can use the internal Lightning node and install plugins. bitcoinix started BTCPay with no admin, so until the operator registered, any local user, or a service that can reach the port, could register first and take it. The window also covers the onion service and any LAN or WireGuard address. BTCPay 2.4.7 has no setting that closes it: - There's no option, environment variable or CLI flag to create the first admin or to require a token or an invite for it. - `disable-registration` (default true) locks registration only once the first admin exists. - Turning `LockSubscription` on before that blocks the web form, but not `POST /api/v1/users`. While no admin exists, BTCPay treats an anonymous caller of the Greenfield API as an admin and lets it create one. The regtest test used exactly this request until now. At the network level, loopback can't tell local users apart. `IPAddressAllow` filters by address. netns-isolation lets every process in the host namespace reach the service namespaces through the bridge. A UID owner match in the firewall would need an allow list of every client (the operator's SSH tunnel, Tor, a reverse proxy) for both iptables and nftables. BTCPay binds only to an address and port, so a Unix socket would mean a new listener setup and would break the onion service and existing tunnels. So this PR creates the admin before BTCPay opens its port: - A new oneshot unit `btcpayserver-admin` runs before each start of `btcpayserver`. If the database has an admin, it exits. - Otherwise it starts BTCPay in a private network namespace (`PrivateNetwork`), bound to `127.0.0.1`, which no other process can reach. It creates `admin@localhost` through the Greenfield API with the password in the new secret `btcpayserver-admin-password`, then stops BTCPay. BTCPay then locks registration. - `btcpayserver` requires the unit, so it doesn't start when the admin can't be created. - The secret belongs to `services.btcpayserver.user` and `.group`, so a custom user or group works with `setup-secrets`. - The setup instance's API URL follows `services.btcpayserver.rootpath`, with `/` and a trailing `/` treated like BTCPay does. - The BTCPay config is now a function of the bind address, because BTCPay binds to every `bind` in its config file and on its command line. - Nodes that already have an admin keep it and don't run the setup instance. Nodes that ran without an admin before this change may already have an admin that isn't the operator's. The docs say how to check the admins in Server Settings > Users. An admin that isn't yours could have installed plugins that run as the `btcpayserver` user and use the Lightning node, so the docs say to treat the node as compromised: stop BTCPay Server, move the funds to a wallet this node doesn't control and set up the node again. They give no in-place recovery steps. Docs: a new "Connect to BTCPay Server" section with "Check the admin accounts" in `docs/services.md`, the 0.2.0 upgrade notes and release notes, the example config and the BTCPay recipe in `dev/dev-features.sh`. The old warning in `examples/configuration.nix` about creating the admin before enabling the onion service is gone, since the admin now exists first. The 0.2.0 notice is for every node with BTCPay. Nodes without an admin now sign in with the generated account instead of registering. Nodes with an admin should check that it's theirs. Setups that supply their own secrets must add the new one. ## Testing The `btcpayserver` VM test now checks that: - `btcpayserver-admin` runs with `PrivateNetwork`. - `admin@localhost` with the generated password is a `ServerAdmin`. - An anonymous `POST /api/v1/users` gets 401, with and without `isAdministrator`. - `/register` redirects. Before this change, the anonymous request created the first admin. The regtest test relied on it. That test now signs in as the generated admin for its Greenfield request. BTCPay accepts Basic auth only in an account's first five minutes, so a test helper resets the account's creation time before each request. New eval tests in `test/configuration.nix`: - With a custom user and group, the secret's owner is that user and group, and both exist. - The health URL of the setup instance for `rootpath` null, `/`, `btcpay`, `/btcpay` and `btcpay/`. Results: - `regtest` VM scenario: pass. - `netnsRegtest` VM scenario: pass on an earlier revision of this branch, without the last fixes. That run checked the `bind` handling in a service namespace: the config file's `bind` is the namespace address, so the setup instance gets its own config with `bind=127.0.0.1`. An earlier version passed `--bind=127.0.0.1` on the command line and failed in both scenarios. - The `shellcheck-services` build in the VM scenarios covers the new unit script. - `checks.x86_64-linux.module-config` and `checks.x86_64-linux.test-runner`: pass. Not tested: the mainnet scenarios, a running node with `rootpath`, and a rerun of `btcpayserver-admin` on a node that already has an admin. - After the rebase onto master c3d955c (#283), `module-config`, `test-runner`, `ci-workflows`, `shellcheck` and `regtest` pass on the KVM host. On master, the notice is a warning until 0.2.0 is released, and the tests pass with `version.nix` at 0.1.6 and at 0.2.0. ## Models Claude Opus 5.5 wrote the change. Codex GPT-5.6 Sol, Codex GPT-6 Astra (two passes plus rechecks), Kimi K3.1 Pro (two passes), DeepSeek V4.1 Flash 1017 and GLM 5.3 reviewed it. Claude Opus 5.5 rebased it onto #224 and #283.
#267) Fixes #67. Without a host, `nix-bitcoin-wg-connect` ran `lndconnect` to find the node's external IP. `lndconnect` does this through `go-external-ip`, which queries third-party IP lookup services over clearnet. That revealed the node's public IP to them, also on a node that otherwise uses only Tor. #201 documented the lookup, but the command still did it. This makes the host required. Without it, the command prints a usage message and exits with status 1: ``` Usage: nix-bitcoin-wg-connect [--text] <host> <host> is the address where your WireGuard client reaches this node: its public IP or hostname, or its LAN IP for a client in your local network. 'ip address' lists the node's own addresses. Behind NAT, your router shows the public IP. ``` The rest of the command works as before. The preset no longer references the `lndconnect` package. A call that used to work now fails, so this adds a config version 0.2.0 notice for configs that import the preset (`modules/versioning/0.2.0/wireguard-connect-host.nix`). `docs/upgrading.md` and `docs/release-notes.md` get 0.2.0 entries. The note from #201 in `docs/services.md` now says that the address is required and how to find it. The dev topic `dev/topics/lndconnect-and-wireguard.sh` passes a host. ## Testing - `wireguard-lndconnect` passes. A new subtest runs the command without a host and checks that it fails with the usage message and prints no config. - `checks.x86_64-linux.module-config` passes. The new `testVersioningWireguardConnectHost` checks that the notice fires for an older config with the preset and not without the preset, and that a config at 0.2.0 doesn't get it once 0.2.0 is released. Without the notice file, it fails. - `checks.x86_64-linux.test-runner` and `nix eval .#ciTestInfo` pass. - `shellcheck` passes on `dev/topics/lndconnect-and-wireguard.sh`. - The CVE scan node (`test/ci/scan-node.nix`) got `lndconnect` through the preset before. It now enables `services.lnd.lndconnect.enable`, so the scan still covers `lndconnect`. It evaluates, with `lndconnect` in its closure. - After the rebase onto master c3d955c (#283), `module-config`, `test-runner`, `ci-workflows`, `shellcheck` and `wireguard-lndconnect` pass on the KVM host. `acknowledged` replaces `current`, because master now rejects config version 0.2.0 before the release. It checks that a config at 0.2.0 doesn't get the notice once 0.2.0 is released. On master, the notice is a warning until 0.2.0 is released, and the tests pass with `version.nix` at 0.1.6 and at 0.2.0. ## Models Claude Opus 5.5 wrote the change. Codex GPT-5.6 Sol, Codex GPT-6 Astra (two passes), Kimi K3.1 Pro (two passes), DeepSeek V4.1 Flash 1017 and GLM 5.3 reviewed it. Claude Opus 5.5 rebased it onto #224 and #283.
…ory (#275) Fixes #122. With `services.clightning.replication.local.directory`, nothing tied clightning to the disk or share that should hold the replica. Only the SSHFS setup had a dependency, through `bindsTo` on `clightning-replication-mounts`. When the mount for a local directory was missing, tmpfiles created the directory on the filesystem below the mount point, and clightning wrote the replica there, usually to the primary disk. With `encrypt`, the mounts service ran `mkdir -p` and `gocryptfs -init` there too. The node looked healthy, but a failure of the primary disk took both copies. `docs/services.md` said that clightning doesn't start while the target is unavailable, which held only for SSHFS. This PR adds `RequiresMountsFor` for `local.directory` to `clightning.service`, and to `clightning-replication-mounts.service` when `encrypt` is set. systemd then mounts the directory first and doesn't start these units while the mount fails. A directory on the root filesystem has no mount to wait for, so it starts as before. systemd splits `RequiresMountsFor` and `ReadWritePaths` at whitespace, unquotes each word and expands `%` specifiers. So the module now writes the directory as a quoted word, with `\` and `"` escaped and `%` doubled, in both settings. Before, a directory with a space became two paths, and clightning failed with `226/NAMESPACE`. systemd can only wait for the mounts it knows, like `fileSystems` entries, and it doesn't follow symlinks. The docs now say this, with a `fileSystems` example for an external disk. I didn't add an assertion or a warning for a `local.directory` outside a declared mount. A replica on the root filesystem or a ZFS dataset that ZFS mounts itself is valid, so a check would break or nag valid configs. clightning now stays down without the mount, so there's a 0.2.0 notice for local replication, with upgrade notes and a release note. The notice shows for every local replica directory, also on the root filesystem, where nothing changes. A condition that reads `fileSystems` would miss the mounts that systemd knows from elsewhere, like `systemd.mounts`. ## Testing - `test/configuration.nix`: - `testReplicationRequiresLocalMounts` checks `RequiresMountsFor` on both units for a local directory, with and without `encrypt`, and its absence with SSHFS. - `testReplicationQuotesLocalDirectory` checks the quoting of a path with a space, `"`, `\` and `%` in `RequiresMountsFor` and `ReadWritePaths`. - `testVersioningReplicationLocalMounts` checks the notice for local directories and its absence with SSHFS. - These tests fail without this change. `checks.module-config` (139 tests) and `checks.test-runner` pass. - `clightning-replication` VM scenario: passes. A new last subtest switches to a config that declares a `nofail` mount at `/mnt/replica disk` whose disk is missing. clightning's start fails with result `dependency`, no replica appears under the mount point, and `systemctl show` lists the path as one word in `RequiresMountsFor` and `ReadWritePaths`. Without the mount dependency (checked with `/mnt/replica`), the switch succeeds and clightning starts anyway. Without the quoting, systemd ignores `disk` as a relative path, and clightning fails with `226/NAMESPACE` instead of the dependency. The subtest fails in both cases. - `nix eval .#ciTestInfo`: passes. - The mdBook build passes. - After the rebase onto master c3d955c (#283), `module-config`, `test-runner`, `ci-workflows` and `clightning-replication` pass on the KVM host. `acknowledged` replaces `current`, because master now rejects config version 0.2.0 before the release. It checks that a config at 0.2.0 doesn't get the notice once 0.2.0 is released. On master, the notice is a warning until 0.2.0 is released, and the tests pass with `version.nix` at 0.1.6 and at 0.2.0. ## Models Claude Opus 5.5 wrote the change. Codex GPT-5.6 Sol, Codex GPT-6 Astra (two passes plus a recheck), Kimi K3.1 Pro (two passes), DeepSeek V4.1 Flash 1017 and GLM 5.3 reviewed it. Claude Opus 5.5 rebased it onto #224 and #283. Kimi K3.1 Pro (two passes) and Claude Fable 5.2 reviewed the first rebase.
…276) Fixes #66. Fixes #153. `services.hardware-wallets` gives Ledger and Trezor devices to group `hardware-wallets`. Two things bypassed that group: - Our Trezor rules added `TAG+="uaccess"`. - systemd's `70-uaccess.rules` adds the same tag to every device in its hardware wallet hwdb, which includes all Ledger and Trezor devices. In systemd 262, which master pins, that's `SUBSYSTEM=="usb", ENV{ID_HARDWARE_WALLET}=="1", TAG+="uaccess"` and the same rule for `hidraw`. With the tag, `73-seat-late.rules` has systemd-logind give the user of the active local session an ACL on the device, also when that user isn't in the group. The module also turned on the Trezor Bridge (`services.trezord.enable = true`). In the pinned nixpkgs, trezord runs as user `trezord`, which isn't in group `hardware-wallets`. The nixpkgs `51-trezor.rules` set `GROUP="trezord"`, but our rules come later and replace it. So the bridge couldn't open the device. Making it work lets every local user and service use the Trezor through the bridge's HTTP API on `127.0.0.1:21325`, which has no authentication. Nothing in bitcoinix uses the bridge. HWI and `trezorctl` open the device directly. This PR: - moves our rules to `71-hardware-wallets-ledger.rules` and `71-hardware-wallets-trezor.rules`, and each rule line now removes the tag with `TAG-="uaccess"`. udevd sorts the files of `/etc/udev/rules.d` and systemd's own rules dir together by name. So ours run after `51-trezor.rules` and `70-uaccess.rules`, and before `73-seat-late.rules`, which applies the tag. In systemd 260, `TAG-=` drops the tag from the device's current tags. `73-seat-late.rules` matches current tags, and logind checks the current tag again before it sets ACLs on a session switch. - removes the tag only on the devices our rules give to the group. systemd's hwdb also lists generic USB serial chips and other wallets, which no group would get otherwise. - makes the Ledger rules match every Ledger device in systemd's hwdb: all products of vendor `2c97`, and the HW.1 and early Nano IDs of vendor `2581`. They matched only `2c97:0001` before. Real Ledger devices show other product IDs, for example a Nano S as `2c97:1011`, so the group didn't get them and the session did. - adds `services.hardware-wallets.trezorBridge` (default `false`). It turns on trezord and sets `SupplementaryGroups` on its unit, so a switch restarts a running bridge with the group. The option description says what the bridge exposes. - warns when trezord runs with `trezor` but without the group, since it then can't open the device. That happens when `services.trezord.enable` is set directly. The warning stays off when trezord gets the group in another way: through `users.users.trezord`, `users.groups.<group>.members`, the unit's `Group` or `SupplementaryGroups`, or `services.hardware-wallets.group = "trezord"`. - adds two 0.2.0 notices, upgrade notes, release notes and a paragraph in the Trezor section of `docs/services.md`. One notice covers session access for Ledger and Trezor users. The other covers the bridge, for Trezor users who don't run trezord. A device that's plugged in while you deploy keeps the session user's ACL until you unplug it. The upgrade note says so. A config that turned the bridge off with `services.trezord.enable = lib.mkForce false` gets the bridge notice too, although nothing changes for it. Detecting that needs option priority introspection, so this config only has to bump `configVersion` once more. ## Testing - New tests in `test/configuration.nix`: - Every Ledger and Trezor rule line sets the group and removes the `uaccess` tag. The `2c97` rule matches every product, and the `2581` rule has the HW.1 IDs. - trezord is off by default and needs `trezor`. With the bridge on, its unit has the group. - The warning appears only when trezord runs with `trezor` but without the group. It doesn't appear with `trezorBridge`, `users.users.trezord.extraGroups`, `users.groups.hardware-wallets.members`, the unit's `Group` or `SupplementaryGroups` (also as a space-separated string), or `group = "trezord"`. - Each notice fires only for the configs it describes. - The check build lists the system's udev rules dir, which on NixOS also holds copies of systemd's rules. It checks that `51-trezor.rules`, `70-uaccess.rules`, our two files and `73-seat-late.rules` sort in that order, and that systemd still tags hardware wallets in `70-uaccess.rules`. It also runs `udevadm verify` on our files. - These tests fail with our files at `52-`, and with `TAG-="uaccess"` removed. - `nix build .#checks.x86_64-linux.module-config` (139 tests) and `.#checks.x86_64-linux.test-runner` pass. - `nix eval .#ciTestInfo` passes. - VM scenario `netns` passes on the final head. It enables `services.hardware-wallets.trezor` and `ledger` through `full`. Not tested on a device. I didn't run `udevadm test` against a fake device in a VM. - After the rebase onto master c3d955c (#283), `module-config`, `test-runner`, `ci-workflows` and `netns` pass on the KVM host. On master, the notice is a warning until 0.2.0 is released, and the tests pass with `version.nix` at 0.1.6 and at 0.2.0. ## Models Claude Opus 5.5 wrote the change. Codex GPT-5.6 Sol, Codex GPT-6 Astra (two passes plus rechecks), Kimi K3.1 Pro (two passes), DeepSeek V4.1 Flash 1017 and GLM 5.3 reviewed it. Claude Opus 5.5 rebased it onto #224 and #283. Kimi K3.1 Pro (two passes) and Claude Fable 5.2 reviewed the first rebase.
…279) Fixes #95. The backups service copied the whole lnd and Core Lightning data dirs while the daemons ran. So the backup had lnd's `channel.db` and Core Lightning's `lightningd.sqlite3`, copied while the daemons wrote them. A copy made during a write can be torn. And a node that runs from an outdated copy can broadcast a revoked channel state. The peer can then take all funds in that channel. The docs didn't warn against restoring these files. The bitcoind wallet files were copied live too. This PR changes three things: - The filelist leaves out the Lightning channel databases: - lnd's `graph` dir. In lnd 0.21 it holds `channel.db`, `sphinxreplay.db` and `wtclient.db`, or `channel.sqlite` and `lnd.sqlite` with the SQLite backend. - Core Lightning's `lightningd.sqlite3` and the SQLite files that `services.clightning.wallet` sets, such as a replica. Each database also gets a `<file>-*` line for its journal files. Like Core Lightning, the DSN is split at the first `:` only. A relative path in it starts in the network dir, and an empty one names no file. - The gocryptfs dir of an encrypted replica in `local.directory`, which holds the encrypted database. With SSHFS or encrypted replication, also the mounts dir `/var/cache/clightning-replication`, which holds the SSHFS cipher dir and the plaintext mount. The paths are normalised, because duplicity matches them as strings, so `./` or `../` would slip through. duplicity also reads each line as a glob, so `[`, `*` and `?` in a path are escaped as one-char classes. Only paths under `services.duplicity.root`, normalised too, are listed, because duplicity aborts the whole backup on a selection outside its root. These entries come first in the filelist, so `extraFiles` can't include them. The backup keeps the files for recovery: `lnd-seed-mnemonic` and `channel.backup` for lnd, and `hsm_secret` and `emergency.recover` for Core Lightning. lnd and Core Lightning replace both files atomically, so a live copy of them is safe. - A new `bitcoind-wallet-backup` unit runs before each backup, like the PostgreSQL dumps. It runs as the bitcoind user with the usual hardening, write access only to `/var/lib/bitcoind/wallet-backups`, and network access only to `localhost` and bitcoind's RPC address. Here's what it does: - It removes the files of the last backup. It deletes only the files it writes, because the dir can also hold other files, like a wallet named `wallet-backups`. - If bitcoind runs, it asks it for a consistent copy of each loaded wallet with `backupwallet`. Each copy goes to `wallet-<sha256 of the wallet name>.dat.tmp` and is renamed to `wallet-<sha256>.dat` only when it's complete. The hash keeps the file name short for any wallet name. `wallet-names.json` maps each copy to its wallet name, so a restore can find the right file. - If bitcoind is stopped, it makes no copies, because the wallet files are consistent then. - If bitcoind is starting or stopping, or a copy fails, the unit fails, and so does the `duplicity` unit after the backup. `bitcoin-cli` runs with `-noconf` and explicit RPC options. The operator can replace `bitcoin.conf` in the data dir, and a planted config could make `bitcoin-cli` send the first line of a file it can read to any address. With the `bitcoind-remote.nix` preset, the wallets are on the other node, so the unit is masked and the backup doesn't start it. The live wallet files stay in the backup, because they're the only copy of wallets that bitcoind doesn't load. - `docs/services.md` gets a Backups section. It says what the backup holds and what it leaves out and why. It and the `postgresqlDatabases` option say not to list Core Lightning's PostgreSQL database, because its dump is an outdated copy of the channel state. It also says how to recover Lightning funds: the seed and `channel.backup` for lnd, `hsm_secret` and `emergency.recover` for Core Lightning, and database replication for a Core Lightning database that's always current. The backup no longer covers data it covered before, and the `duplicity` unit can now fail in new cases. So a 0.2.0 notice tells every config with backups about both changes. Backups made before this change still contain the channel databases. The notice and the upgrade notes say to never restore them. ## Testing - `test/suite/backups.py` runs two backups while bitcoind and the Lightning daemons run. Both must have the copy of the loaded test wallet and no channel database. The test checks that `wallet-names.json` maps the copy to the wallet. Before the second backup, the test adds a stale copy, a `wallet.dat` and another file. The second backup must leave out the stale copy and any `.tmp` file, and the other two files must still exist. After the backup with bitcoind stopped, the test checks these things: - The backup has no wallet copy. - It has lnd's `channel.backup` and Core Lightning's `emergency.recover`, next to the seed and `hsm_secret`. - `graph/mainnet/channel.db` and `lightningd.sqlite3` exist on disk but aren't in the backup. lnd writes `channel.backup` only once it's synced to the chain, which the test node never is, so the test adds a stand-in file for that check. - `test/configuration.nix` checks these things: - The exclusions come first in the filelist: for the default config, a DSN with `./`, `../`, `//` and a replica name that ends with `:`, a DSN with an empty replica, an empty `sqlite3://` DSN, a database named `channel[1].sqlite3`, an encrypted local replica, an encrypted SSHFS replica, a duplicity root of `/var/lib` with a replica outside it, and a root of `/var/lib/.`. - The wallet unit is defined and started for a local bitcoind, and not for the `bitcoind-remote.nix` preset or `disablewallet`. - The 0.2.0 notice shows for any config with backups. - `nix eval .#ciTestInfo`, `.#checks.x86_64-linux.module-config` and `.#checks.x86_64-linux.test-runner` pass. - VM scenario `default` (the secure node scenario with backups, lnd, Core Lightning and BTCPay Server) passes. - VM scenario `netns` with the backups test turned on passes. It checks that the wallet unit reaches bitcoind across the namespace with its IP allow list. - I ran duplicity 3.0.7 on its own with a filelist like the new one. It leaves out the databases, their `-journal`, `-wal` and super-journal files, a database named `h`, and `channel[1].sqlite3` with its journal. It keeps `channel1.sqlite3`, `channel.backup`, `hsm_secret` and `emergency.recover`. - After the rebase onto master c3d955c (#283), `module-config`, `test-runner`, `ci-workflows` and `default` pass on the KVM host. On master, the notice is a warning until 0.2.0 is released, and the tests pass with `version.nix` at 0.1.6 and at 0.2.0. ## Models Claude Opus 5.5 wrote the change. Codex GPT-5.6 Sol, Codex GPT-6 Astra (two passes plus rechecks), Kimi K3.1 Pro (two passes), DeepSeek V4.1 Flash 1017 and GLM 5.3 reviewed it. Claude Opus 5.5 rebased it onto #224 and #283.
Since #224, scenarios that replace the test set with `tests = mkForce { ... }` failed to evaluate with "attribute 'i2pd' missing": test.data.i2pd read config.tests.i2pd, which such scenarios don't define. This broke wireguardIptablesLegacy, lnconnectNoOperatorRole and the selectedTests example pattern. CI doesn't build them, so the failure went unnoticed. A missing tests.i2pd entry now counts as false. Which tests run is unchanged. Follow-up to #224
bitcoinix currently selects packages from stable and unstable nixpkgs. This change uses a single
nixpkgsinput trackingnixos-unstablefor systems and packages. The flake NixOS module defaultsnix-bitcoin.useVersionLockedPkgsto true; the 0.2.0 migration explains when callers instead control the service package pin.pkgsUnstableplumbing. Inline package selection inpkgs/default.nix, remove generatedpkgs/pinned.nix, and simplify version reporting and update helpers. Preserve public.pinnedpaths and the non-flake lock-file adapter.modules/versioning/0.2.0/, using master's collector and its automatic documentation references. Cover package-pinning/database downgrade risks, whole-system unstable evaluation, firewall/FUSE defaults and custom containers. Document I2P validation limits. Keep the NixOS assertion safeguard against migration recursion, and test both individual notices and the assertion. Read the container runner's config version from the notice directories.3210fc9,21a1f43) with the supplied hashes, replacing the local patch. They fix initialization races and reporting height zero without a source.Rebased on
masteratcf39a66(including #253 and the versioning refactor). Ranhelper/update-flake.sh; the single nixpkgs input is nowd5cc6833999746cffdfe0598f7bc801a57b887a9, verified as the currentnixos-unstablehead on 2026-11-16. Core Lightning stays at 26.06.10; compared with the previous PR head, LND moves to 0.21.8-beta and RTL to 0.15.17. Rechecked treewide TODO-EXTERNAL comments and the CVE exceptions against the new runtime closure.Validation after this rebase/update:
nix flake check --all-systems(including module/migration checks, test-runner checks, LND macaroon filters, CVE tools and workflow checks).default,netns,netnsRegtest,trustedcoin,i2pandi2pLocal. The firstnetnsRegtestrun failed during LND's automatic macaroon-cleanup restart withpanic: unable to subscribe to chans: subscription server shutting down; the unchanged VM retry passed. This PR and current master select the identical LND 0.21.8-beta derivation.--system-call-filter=@memlock.ARM outputs were evaluated, not built or VM-tested. Other VM scenarios and the complete package build set were not rerun.