831 Commits
Author SHA1 Message Date
Jonas Nick 37931e5288 Merge fort-nix/nix-bitcoin#848: lnd: don't pass the admin macaroon in curl argv
df184b6e06 lnd: don't pass the admin macaroon in `curl` argv (Jonas Nick)

Pull request description:

Top commit has no ACKs.

Tree-SHA512: d18fa7176c59f33a38222a2d3d44320769ac83e091104594a9572e44ce38205d341767ea598da1b5500208c1e9f6645ed5c3b9390438d95912e44d1c5f3a4752
2026-08-13 10:44:26 +00:00
Jonas Nick 0d86dcd7da Merge fort-nix/nix-bitcoin#847: update nixpkgs
f51460749a ci: disable the nixos-search test (Jonas Nick)
3b798f5ebf test: increase VM memory to 4 GiB (Jonas Nick)
17f0d98c22 update nixpkgs (Jonas Nick)

Pull request description:

Top commit has no ACKs.

Tree-SHA512: 0e40353d9d7937dd7a80c05416360c30ada7ee231d6263883072d60a707443e765d35f6a393e718ed1ef66f2e2cdbd1deadd6cd720dccb5c5e18711159cda38a
2026-08-13 10:43:37 +00:00
Jonas Nick df184b6e06 lnd: don't pass the admin macaroon in curl argv
`lnd-create-macaroons` interpolated the hex-encoded admin macaroon into
`curl`'s argv, where any local user could read it from world-readable
`/proc/<pid>/cmdline`. The unit's `ProtectProc=invisible` doesn't apply,
because `nbLib.rootScript`'s `+` prefix disables sandboxing for the
process. Pass the header on a file descriptor instead, so the credential
never enters any argv (`printf` is a bash builtin); the request sent to
lnd is unchanged. Only configurations with a non-empty
`services.lnd.macaroons` were affected, which `services.charge-lnd` and
`services.btcpayserver` with `lightningBackend = "lnd"` set automatically.
2026-08-12 18:02:07 +00:00
Jonas Nick 17f0d98c22 update nixpkgs
bitcoin: 31.0 -> 31.1
bitcoind: 31.0 -> 31.1
btcpayserver: 2.3.4 -> 2.4.2
clboss: 0.16.0 -> 0.16.1
2026-08-11 09:41:31 +00:00
Jonas Nick 34a18f92ee netns-isolation: fix netns-exec being executable by all normal users
The `netns-exec` wrapper was created with `group = ""`, which makes the
`security.wrappers` activation run `chown ${allowedUser}:`. GNU chown
resolves the trailing colon to the owner's login group, and because the
operator is defined with `isNormalUser = true`, that group is the shared
group `users`. Together with mode 550, this made the wrapper executable
by every normal user on the host instead of only by `allowedUser`.

The wrapper carries `cap_sys_admin=ep` and the NixOS security wrapper
performs no owner check, so any normal user could enter `nb-joinmarket`,
the only netns that `netns-exec` permits. This exposes joinmarketd's
unauthenticated control port on 127.0.0.1 inside that netns and allows
sending packets from the joinmarket netns address. This can only ever become a
problem if there's a second, normal user on the host.

Use mode 500 so that only `allowedUser` can execute the wrapper. Also
set the group to `root`, so that `users` doesn't silently become an
authorized group again if the mode is ever loosened.

The netns-isolation test asserted this property with
`runuser -u clightning -- netns-exec nb-bitcoind ip a`, which fails
regardless of the file mode, because `clightning` is a system user with
its own group and `nb-bitcoind` is not in netns-exec's allowlist.
Replace it with a check that a normal user is denied by the exec
permissions, and assert the reason for each failure instead of only the
exit status.
2026-08-09 19:40:39 +00:00
Jonas Nick f9a0e469d5 update nixpkgs
bitcoin: 30.2 -> 31.0
bitcoind: 30.2 -> 31.0
clboss: 0.15.1 -> 0.16.0
clightning: 25.12.1 -> 26.04.1
elementsd: 23.3.2 -> 23.3.3
lightning-loop: 0.31.5-beta -> 0.33.0-beta

lightning-loop 0.31.7+ blocks until lnd's chain notifier is ready
(lightninglabs/loop@bde49d7a), so the workaround sleep added in the
previous commit is no longer needed for lightning-loop. The
lightning-pool workaround stays — pool has no equivalent fix and
isn't actively maintained.

Note: nbxplorer test fails (presumed incompatibility with bitcoin 31).
2026-05-11 08:15:49 +00:00
Jonas Nick 4c22a3c594 update nixpkgs
bitcoin: 30.0 -> 30.2
bitcoind: 30.0 -> 30.2
bitcoind-knots: 29.2.knots20251110 -> 29.3.knots20260210
btcpayserver: 2.2.1 -> 2.3.4
clightning: 25.09.2 -> 25.12.1
elementsd: 23.2.4 -> 23.3.2
lnd: 0.19.3-beta -> 0.20.1-beta

lnd 0.20 makes its chain notifier subsystem ready later in startup
than its RPC server. lightning-loop and lightning-pool both subscribe
to chain notifications right after dialing lnd, which fails before
the notifier is up and crashes the daemon. Add a 5s ExecStartPre
sleep to both services as a temporary workaround.
2026-05-11 08:14:22 +00:00
Erik Arvstedt 53104f55f9 btcpayserver: update postgresql setup to NixOS 25.11 2025-12-27 12:40:53 +01:00
Erik Arvstedt 54651163ba treewide: fix eval warnings for NixOS 25.11 2025-12-23 10:45:43 +01:00
Erik Arvstedt e6e3a13dbb work around CVE-2024-23342 for pkgs hwi, trezor 2025-11-22 15:21:32 +01:00
Erik Arvstedt bba75b0a7f support running joinmarket with bitcoind 29 2025-10-23 08:15:34 +02:00
Erik Arvstedt 9311fb9a1b lnd: disable log file, disable log timestamps
This is the default for nix-bitcoin services.
`no-timestamps` has been added in lnd 0.19.0-beta.

Also remove deprecated option `bitcoin.active`.
2025-06-11 16:08:26 +02:00
Jonas Nick 120daaaaa3 Merge fort-nix/nix-bitcoin#787: mempool: 2.5.0 -> 3.2.1
7822e2c9d3 mempool: add frontend settings (Erik Arvstedt)
81112a0553 mempool: 2.5.0 -> 3.2.1 (Erik Arvstedt)
9a044fbfed mempool: remove unneded nginx config files (Erik Arvstedt)
710a92d18c mempool: improve comments (Erik Arvstedt)
d61099a535 mempool: minor refactorings (Erik Arvstedt)
c48b99782d mempool: fix version (Erik Arvstedt)

Pull request description:

ACKs for top commit:
  jonasnick:
    ACK 7822e2c9d3

Tree-SHA512: 50f953a324641fa87f913035d99d2a739c33bb8adca20a5337c0061809ff3e17315bb7761655689b791ef9f53fa3995148ca4d4729bf989074cd52ff41b6f03d
2025-06-09 12:30:24 +00:00
Erik Arvstedt 4763e2e8f0 clightning: increase service start timeout 2025-06-03 11:41:33 +02:00
Erik Arvstedt 7822e2c9d3 mempool: add frontend settings 2025-06-02 10:46:55 +02:00
Erik Arvstedt 81112a0553 mempool: 2.5.0 -> 3.2.1 2025-06-02 10:46:54 +02:00
Erik Arvstedt 9a044fbfed mempool: remove unneded nginx config files
mempool.conf, nginx.conf were not used in nix-bitcoin.
2025-06-02 10:46:54 +02:00
Erik Arvstedt 710a92d18c mempool: improve comments 2025-06-02 10:46:54 +02:00
Erik Arvstedt 343bf4731c charge-lnd: remove electrum server support
This has been removed upstream:
https://github.com/accumulator/charge-lnd/commit/481ccf5282ca980435267870172a0d7f14ef6939
2025-05-25 13:28:21 +02:00
Erik Arvstedt c65cfdcbec bitcoind: remove upper limit of option dbcache
The upper limit has been removed.
See item `The maximum allowed value...` at
https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-29.0.md#updated-settings
2025-05-22 15:04:37 +02:00
Erik Arvstedt ce6244cc69 clightning: set service as active only after clnrest has started 2025-05-20 22:42:41 +02:00
Erik Arvstedt a2a0174d0f bitcoind-rpc-public-whitelist.nixbitcoind-rpc-public-whitelist: add getblockfrompeer
This is used by nbxplorer since v2.5.24 on pruned nodes:
https://github.com/dgarage/NBXplorer/pull/511
2025-05-15 23:11:37 +02:00
Erik Arvstedt 69090cddfa pinned pkgs: add bitcoind-knots 2025-05-13 00:00:54 +02:00
Erik Arvstedt 815f2cd325 clightning: don't set datadir for bitcoin-cli plugin
This option is unneeded because `bitcoin-cli` auth and connection
settings are already provided by other options like `bitcoin-rpcpassword`.

In bitcoind versions prior to 29.0, option `datadir` (passed by clightning to `bitcoin-cli`)
was therefore ignored.
Since 29.0, option `datadir` is always checked for validity. This causes a
file permission error because service clighting has no access to the
bitcoin datadir. This is now fixed.
2025-05-09 13:56:18 +02:00
Erik Arvstedt 04b6a09be4 clightning-plugins: use clnrest, remove Python version 2025-05-09 13:32:19 +02:00
Erik Arvstedt 4aaef5fdf4 services: use wants dependency where possible
Let A be a service that depends on another service B.
When A can gracefully handle failures and restarts of B, use
```
wants = [ "B.service" ];
after = [ "B.service" ];
```
instead of
```
requires = [ "B.service" ];
after = [ "B.service" ];
```
in the definition of A.

This way, A keeps running when B is stopped or restarted after a failure.
With `requires`, A is instead stopped when B is stopped or restarted due to a failure.

This brings two benefits:

1. Improved uptime
Examples:
- RTL keeps running when one lightning node has failed
- btcpayserver keeps running and accepting on-chain payments when the lightning node has crashed

2. Avoids a systemd bug where depending units (`A.service` in the
above example) are not restarted when their dependency fails
(issue github/systemd#18856, no full link to avoid spamming the issue).
In real world nix-bitcoin deployments, this issue was only likely to
appear when clightning failed during activation, causing depending
units (like `RTL`) to stop and not be restarted.
All services depending on `clightning` have now been changed to use
`wants`, thereby avoiding the bug.

Services `electrs` and `lightning-loop` fail when their respective
dependencies stop, so these services have not been changed.
I also haven't changed services `joinmarket` and
`joinmarket-yieldgenerator`. Further manual testing is needed to
determine if they can be switched to `wants`.
2025-01-29 20:44:26 +01:00
Jonas Nick ed163fece1 update nixpkgs
bitcoin: 28.0 -> 28.1
bitcoind: 28.0 -> 28.1
clightning: 24.11 -> 24.11.1
electrs: 0.10.7 -> 0.10.8
extra-container: 0.12 -> 0.13
lnd: 0.18.3-beta -> 0.18.4-beta
2025-01-21 16:51:29 +00:00
Erik Arvstedt 09ba739719 nbxplorer: remove deprecated option
Fixes this warning:
Explorer: Options 'automigrate' is obsolete and ignored...
2024-12-14 10:52:26 +01:00
Erik Arvstedt 3ce3a000b2 modules: update to NixOS 24.11 2024-12-14 10:52:26 +01:00
Erik Arvstedt daa3bfbae3 lndconnect: add clnrest 2024-11-27 21:35:46 +01:00
Erik Arvstedt ad2a128471 rtl: use clnrest
Using `clightning-rest` is no longer supported by rtl.
2024-11-27 21:35:46 +01:00
Erik Arvstedt e74ddd9464 clightning.plugins.clnrest: init 2024-11-27 18:48:24 +01:00
Jonas Nick c0994bfc7b Merge fort-nix/nix-bitcoin#744: update nixpkgs
2f986c80e5 update nixpkgs (Jonas Nick)
76ea066809 trustedcoin: 0.8.2 -> 2024-11-15 (Erik Arvstedt)

Pull request description:

ACKs for top commit:
  erikarvstedt:
    ACK 2f986c80e5

Tree-SHA512: 2824fc5f2c0f5586d1912c237a0b129387a913283d70840c6c4020e168bf924814b335796e863a64b97f6d60aced0e65fd10561fb3c1d4a33542dc235df46d25
2024-11-16 14:57:49 +00:00
Jonas Nick 2f986c80e5 update nixpkgs
bitcoin: 27.1 -> 28.0
bitcoind: 27.1 -> 28.0
clboss: 0.13.3 -> 0.14.0
2024-11-15 19:37:56 +01:00
Erik Arvstedt ca96e1959e lnd: make ExecStartPost extensible
By wrapping the value in a list, users can add other `ExecStartPost` scripts.
The previous scalar value could only be replaced, but not merged with
other definitions.
2024-11-06 16:48:30 +01:00
Erik Arvstedt 8e34b25164 btcpayserver: fix lnd with "bind to any" restAddress 2024-08-29 20:34:36 +02:00
Jonas Nick 6e208d6a7b Merge fort-nix/nix-bitcoin#722: joinmarket: Add option settings
cf3f0dbb2d joinmarket: add option `settings` (Erik Arvstedt)
da2e473158 joinmarket: don't set default config options (Erik Arvstedt)
74eb9a17b6 joinmarket/yieldgenerator: add docs link to description (Erik Arvstedt)
5694408d3a joinmarket: remove deleted option `txfee` (Erik Arvstedt)

Pull request description:

ACKs for top commit:
  jonasnick:
    utACK cf3f0dbb2d

Tree-SHA512: 36754539670dedcc494b28fa8383b189bd8fcf4044e0be624f47db953b189d706ed76df305e10fbea69f4e0dd9c419eb1eaf35de75e860883ea3305456fc31ed
2024-08-13 07:17:49 +00:00
Erik Arvstedt cf3f0dbb2d joinmarket: add option settings
Joinmarket settings can now be freely specified.
2024-08-11 20:16:56 +02:00
Erik Arvstedt da625fc13d bitcoind.rpc.users: improve example
Add RPC entries that don't exist in the public whitelist.
2024-07-31 18:13:29 +02:00
Erik Arvstedt a04c15958a btcpayserver: remove redundant RPC entry from whitelist
`getpeerinfo` already exists in the public whitelist.
2024-07-31 18:13:29 +02:00
Erik Arvstedt fee9dc8c17 bitcoind-rpc-public-whitelist: add getnodeaddresses
`getnodeaddresses` returns addresses of peers the bitcoind instance
has seen over its lifetime. It's safe for public use.
2024-07-31 18:13:29 +02:00
Erik Arvstedt da2e473158 joinmarket: don't set default config options
These options are set by default in `jmclient/configure.py` and don't
need to be repeated.

Some options, like those in section `POLICY`, might be assigned more
suitable default values in future joinmarket releases, so don't override
them in nix-bitcoin.
2024-07-29 11:24:37 +02:00
Erik Arvstedt 74eb9a17b6 joinmarket/yieldgenerator: add docs link to description 2024-07-29 11:22:47 +02:00
Erik Arvstedt 5694408d3a joinmarket: remove deleted option txfee 2024-07-27 19:55:29 +02:00
Jonas Nick 1c6e35e152 Merge fort-nix/nix-bitcoin#718: Update to Nixos 24.05
2a9489ec0b tests/flake: check flake outputs for all systems (Erik Arvstedt)
b7bce52da9 examples: fix call to `start-bash-session.sh` (Erik Arvstedt)
5d0907b064 test/nixos-search: fix running `flake-info` in an offline environment (Erik Arvstedt)
3cc6010658 test/nixos-search/ci-test.sh: remove unneded setup step (Erik Arvstedt)
22c1424552 backups: fix for nixos 24.05 (Erik Arvstedt)
69b3d5f1b3 bitcoind: fix module warning (Erik Arvstedt)
e8e5d8cf4c python3Packages.joinmarket: update to nixos 24.05 (Erik Arvstedt)
7f8563afec python3Packages.pyln-proto: update to nixos 24.05 (Erik Arvstedt)
5d463b1677 treewide: remove `buildPythonPackageWithDepsCheck` (Erik Arvstedt)
fc703c38c9 treewide: remove obsolete `mdDoc` (Erik Arvstedt)
83eb1de24b update to nixos 24.05 (Erik Arvstedt)
7daab61431 rtl: remove unused pkg arg (Erik Arvstedt)

Pull request description:

ACKs for top commit:
  jonasnick:
    ACK 2a9489ec0b

Tree-SHA512: 1e88d52b52050ea39c18570eb22b3b83471ebbf30d7ba77f212947ffaaf80ebb851782aa6a5e42752bdfb0db00fa31d5fb9cebb7f42a50145acfeeef1c1aa934
2024-07-22 13:09:15 +00:00
Erik Arvstedt 22c1424552 backups: fix for nixos 24.05 2024-07-20 22:41:18 +02:00
Erik Arvstedt 69b3d5f1b3 bitcoind: fix module warning
Fix warning:
```
bitcoind.service is ordered after 'network-online.target' but doesn't depend on it
```
2024-07-20 22:41:18 +02:00
Erik Arvstedt fc703c38c9 treewide: remove obsolete mdDoc 2024-07-18 20:57:00 +02:00
Erik Arvstedt 1f32792d31 bitcoind-rpc-public-whitelist: add getpeerinfo
Required by lnd 0.18.0.
2024-07-08 12:54:56 +02:00
Erik Arvstedt 5730afe48e obsolete-options: add removed clightning plugins 2024-04-09 05:30:23 +00:00