Commit Graph
100 Commits
Author SHA1 Message Date
Erik Arvstedt 9019a17bfc versioning: add fulcrum db change info 2023-01-07 19:32:54 +00:00
Erik Arvstedt 4b5b4eac58 examples/deploy-container: fix sudo env propagation
Env vars can't be reliably passed through `sudo`, so always
call nix-shell to setup the env after running sudo.
2023-01-06 23:23:54 +01:00
Erik Arvstedt 8d476cfeaf nix-bitcoin/runAsUserCmd: remove workaround 2023-01-03 16:18:27 +01:00
Erik Arvstedt 314020b246 rtl: 0.13.1 -> 0.13.2 2022-12-20 23:24:24 +01:00
Erik Arvstedt 00cceca861 joinmarket: fix Python packages 2022-12-18 20:01:53 +01:00
Erik Arvstedt e4b8e14d3a clightning: fix Python packages
Patching `pyln-proto` to use cryptography 38 lets
us avoid adding many older Python pkg versions.

The backwards incompatible changes from cryptography 36 to 38
only include the removal of deprecated fns that pyln-proto
doesn't use.
See string "BACKWARDS INCOMPATIBLE" in
https://cryptography.io/en/latest/changelog/
2022-12-18 20:01:53 +01:00
Erik Arvstedt d1ef2a6e1e pythonPackages: improve layout
- Move the creation of the joinmarket Python pkgs from
  `joinmarket/default.nix` to `pkgs/python-packages/default.nix`.

- Move definitions of old pkg versions from the main Python pkgs
  to the joinmarket Python pkgs.
  These old versions are only required by joinmarket.
2022-12-18 20:01:52 +01:00
Erik Arvstedt 74c8593407 pythonPackages: add indentation
This makes the following commit more readable.
2022-12-18 20:01:52 +01:00
Erik Arvstedt 109dccca27 treewide: use mdDoc for descriptions
Enable markdown syntax (instead of docbook) for descriptions.
This only affects external doc tooling that renders the descriptions.
2022-12-18 20:01:52 +01:00
Erik Arvstedt a9c1995ed9 treewide: rename maintainer earvstedt -> erikarvstedt 2022-12-18 20:01:52 +01:00
Erik Arvstedt 9e456ea3a9 shellcheck-services.nix: update to NixOS 22.11 2022-12-18 20:01:52 +01:00
Erik Arvstedt 77d58162e7 test: update to NixOS 22.11 2022-12-18 20:01:52 +01:00
Erik Arvstedt 142cbcfb37 flake: remove 32-bit systems 2022-12-18 20:01:52 +01:00
Erik Arvstedt c9b1e59f20 update to NixOS 22.11
This includes no pkg version updates.
2022-12-18 20:01:52 +01:00
Erik Arvstedt 62515a5696 helper/update-flake: support updating NixOS versions 2022-12-18 20:01:48 +01:00
Erik Arvstedt c5493717b7 lnd: support INADDR_ANY addresses for bitcoind.zmqpubraw*
Also use `mkDefault` when defining `bitcoind.zmqpubraw*` to simplify
overriding for users.
2022-11-11 12:10:00 +01:00
Erik Arvstedt 0447c5bacb treewide: set shebang for bash scripts
These scripts previously failed when called with syscalls like
`execve` (used by, e.g., Python's `subprocess.run`) that use no default
interpreter for scripts without a shebang.
2022-11-08 23:04:56 +01:00
Erik Arvstedt 0de16095e1 clightning-replication: switch system before waiting for server sshd
This is primarily a cosmetic change.
- Increases code clarity because all system test blocks now start with `switch_to_system`
- Optimizes dependency ordering because `switch_to_system` has no
  dependency on the server sshd
2022-11-04 11:51:44 +01:00
Erik Arvstedt d332177d3e clightning: extract var bitcoind
Follow the default module formatting style.
2022-11-04 11:07:36 +01:00
Erik Arvstedt 1b5e51b7fe examples/vm-config: fix syntax error 2022-11-04 00:33:53 +01:00
Erik Arvstedt 565deb770a examples/minimal-vm: add lightning-cli demo command 2022-11-04 00:33:31 +01:00
Erik Arvstedt edbaeb9813 tests: define tests via flake
Advantages:
- Pure test evaluations
- The test framework can now be used by flakes that extend nix-bitcoin
- Most features of `run-tests.sh` are now accessible via `nix build`/`nix run`.
  We keep `run-tests.sh` for advanced features like `scenarioOverridesFile` and adhoc scenarios.

Other changes:
- `run-tests.sh` now builds aggregate VM tests like `basic` or
  `buildable` by creating all VMs in a single evaluation.
  This speeds up the tests and eases debugging by separating the eval and build steps.
- Use the new `nix` CLI which has improved build output logging
  by prefixing output lines with the origin drv name.
2022-11-03 23:08:06 +01:00
Erik Arvstedt 90e942e5ae nodeinfo: rename nodeinfoLib -> lib 2022-11-03 23:08:06 +01:00
Erik Arvstedt 8eaa4cce30 tests: move mkIfTest to nix-bitcoin.lib 2022-11-03 23:08:06 +01:00
Erik Arvstedt 47a09ec214 flake: expose supportedSystems 2022-11-03 23:08:05 +01:00
Erik Arvstedt b0dfa69e84 nixos-search/flake: formatting 2022-11-03 23:08:05 +01:00
Erik Arvstedt d428755399 flake: rename input nixpkgsUnstable -> nixpkgs-unstable
This follows common flake naming conventions.
2022-11-03 23:08:05 +01:00
Erik Arvstedt a12b701e75 tests/container: don't require services.clightning to be defined 2022-11-03 23:08:05 +01:00
Erik Arvstedt 450de19803 tests/run-tests.sh: print examples before running
This eases debugging example failures.
2022-11-03 23:08:05 +01:00
Erik Arvstedt 5f1bb2a8fc tests/copy-src: always copy .git dir
This is required by a later commit that introduces flakes-based test
evaluation. Evaluating local flakes needs a repo dir.
2022-11-03 23:08:05 +01:00
Erik Arvstedt a87a59a86b make-container.sh: improve root handling
Don't auto-switch to root when executing make-container.sh, because
auto root switching is also implemented in extra-container.

Besides simplifying the code, this is useful for a later commit that
introduces flakes-based container building.
With this change, the container is built under the regular user
instead of root, thereby utilizing the user's regular fetcher and
evaluation caches.
2022-11-03 23:08:05 +01:00
Erik Arvstedt b616d7ac1b profiles/hardened: support pure eval mode 2022-11-03 23:08:05 +01:00
Erik Arvstedt 73d2fbb448 add compatibility with Nix PR #6530 (Source tree abstraction)
Avoid adding flake resource paths to the store (via string
interpolation).
This reduces performance and can lead to modules getting imported
twice, once through a local path and once through a store path.

This might not be needed in a future Nix release, in which case we can
revert this.
2022-11-03 23:08:05 +01:00
Erik Arvstedt 3c816b862c tests/vmWithoutTests: poweroff on shell exit
This allows quitting the VM with Ctrl-D like in the minimal example VM.
2022-11-03 23:08:04 +01:00
Erik Arvstedt 1d3f49f8da tests, example: avoid lengthy documentation build
This options manual rebuild takes 30-60s and is triggered by the extra
NixOS options defined by nix-bitcoin.
2022-11-03 23:08:04 +01:00
Erik Arvstedt b840548d40 test/shellcheck-services: add configurable source prefix
This allows using this module for services defined outside of nix-bitcoin.
2022-11-03 23:08:04 +01:00
Erik Arvstedt b412de3ad7 bitcoind: fix rare startup error
Previously, dhcpcd and bitcoind starting up in parallel could lead to
the following error in bitcoind:
```
bitcoind: libevent: getaddrinfo: address family for nodename not supported
bitcoind: Binding RPC on address 127.0.0.1 port 8332 failed.
bitcoind: Unable to bind any endpoint for
```
After the initial failure, the bitcoind service would always restart successfully.

This race condition, where both applications were simultaneously
manipulating network resources, was only triggered under specific
hardware conditions.

Fix it by running bitcoind after dhcp has started (by running after
`network-online.target`).
This bug and the fix only affect the default NixOS scripted
networking backend.
2022-11-02 12:02:03 +01:00
Erik Arvstedt 57b76d4461 pkgs: add lnd 0.15.4 (hotfix)
Includes an emergency hotfix:
https://github.com/lightningnetwork/lnd/releases/tag/v0.15.4-beta
2022-11-01 14:12:56 +01:00
Erik Arvstedt 67949a002a lnd: fix missing RPC permissions when bitcoind is pruned 2022-10-25 22:56:51 +02:00
Erik Arvstedt 49303be2e0 test/shellcheck-services: fix error by excluding unavailable services 2022-10-25 22:36:30 +02:00
Erik Arvstedt 46f17fe313 test/shellcheck-services: simplify accessing service definitions
This also improves performance by removing the extra module evaluation.
2022-10-25 22:36:30 +02:00
Erik Arvstedt 277510c7ee tests: run flake-info in sandbox
Don't use sandboxing in Cirrus CI where namespace support is missing.
2022-10-25 22:04:17 +02:00
Erik Arvstedt c88acbb1bb btcpayserver: use new option certfilepath for lnd 2022-10-24 12:47:01 +02:00
Erik Arvstedt 13a835e88f Revert "pkgs: add lnd 0.15.2"
This reverts commit cf836b5d3b.
2022-10-24 11:50:36 +02:00
Erik Arvstedt 3549725b51 update nixpkgs
btcpayserver: 1.6.10 -> 1.6.12
clightning: 0.12.0 -> 0.12.1
fulcrum: 1.8.1 -> 1.8.2
nbxplorer: 2.3.33 -> 2.3.41
2022-10-24 11:49:03 +02:00
Erik Arvstedt 61c539d5b6 defaultHardening: allow syscall set_mempolicy
This syscall is safe to allow.
It's required by the dotnet runtime (btcpayserver, nbxplorer) update
introduced in the following commit.
2022-10-22 23:54:08 +02:00
Erik Arvstedt cf836b5d3b pkgs: add lnd 0.15.2
Includes an emergency hotfix:
https://github.com/lightningnetwork/lnd/releases/tag/v0.15.2-beta
2022-10-10 13:27:49 +02:00
Erik Arvstedt d3b7e8c432 revert "tests: disable nixosSearch" 2022-09-23 09:04:57 +02:00
Erik Arvstedt c3b97e6728 tests: add shellcheckServices 2022-09-12 21:00:00 +02:00
Erik Arvstedt 01fa900633 shellcheck: fix setup-secrets.sh, spark-wallet 2022-09-12 21:00:00 +02:00
Erik Arvstedt 49e30f7172 test/lib/create-git-repo: fix empty var expansion
When `amend` is empty, expand it to nothing instead of an empty
string (which causes a git error).
2022-09-07 11:02:15 +02:00
Erik Arvstedt 7985e075e5 README: remove nixos-search 2022-09-07 10:24:16 +02:00
Erik Arvstedt c63da4734e tests: disable nixosSearch 2022-09-05 21:11:15 +02:00
Erik Arvstedt 67a573dae8 create-git-repo.sh: fix amend error if there's no branch checked out
In this case, `git commit --amend` fails.

The state of a .git repo existing without a branch being checked out
can be reached through the following sequence of events (which I just
seem to have triggered):
1. The script calls `git init`
2. The user interrupts the script before `git commit` is finished
2022-08-29 00:12:19 +02:00
Erik Arvstedt d9eecb7d4c nixos-search/flake: remove unused output 2022-08-29 00:12:19 +02:00
Erik Arvstedt 4e70db14bc README: fix capitalization 2022-08-29 00:12:18 +02:00
Erik Arvstedt 030be842c8 secrets: use fetchurl derivation
This moves fetching from eval time to build time, which is a better
fit for fetching build time resources.
2022-08-29 00:12:17 +02:00
Erik Arvstedt 1713e016a0 clightning-replication: clarify comment about FUSE mounts 2022-08-28 23:49:12 +02:00
Erik Arvstedt cd3878e357 delete modules/default.nix
This file has been missing some modules for quite some time.
Remove it to simplify maintenance.
2022-08-28 23:49:12 +02:00
Erik Arvstedt f2a4d1fe65 docs/security: fix typo 2022-08-28 23:49:12 +02:00
Erik Arvstedt 3a65dc0dc9 docs/configuration: improve section Remote bitcoind 2022-08-28 23:49:12 +02:00
Erik Arvstedt af115d746b internal scripts: use pinned, cached pkgs
Instead of setting up the script PATH via nix-shell, use
`nix shell` with inputs from the nix-bitcoin flake.
Advantages:
- Uses the nixpkgs version from the nix-bitcoin flake instead of
  `<nixpkgs>` from the user env (NIX_PATH), so the script runtime
  env is reproducible.
- The pkg derivations for the runtime env are cached, which greatly
  increases script startup speed.

This commit was generated by running the following script inside the
repo root dir:

def transform(path, src)
  if src =~ /#! *nix-shell +-i +bash +-p +(.*)/
    pkgs = $1
    if src =~ /^.*?(set -e.*?pipefail)\n/
      set_statement = $1
      src.sub!($&, '')
    end
    src.sub!(/\A.*?#! *nix-shell.*?\n/m, '')

    parents = ([ '..' ] * (path.split('/').count - 1)).join('/')

    [
      '#!/usr/bin/env bash',
      *set_statement,
      %(. "${BASH_SOURCE[0]%/*}/#{parents}/helper/run-in-nix-env" "#{pkgs}" "$@"),
      nil,
      src
    ].join("\n")
  end
end

Dir['**/*.sh'].each do |f|
  src = File.read(f)
  if new_src = transform(f, src)
    puts "Changed file #{f}"
    File.write(f, new_src)
  end
end
2022-08-28 23:49:12 +02:00
Erik Arvstedt b625325487 ci/modules_test: use flake-enabled nix 2022-08-28 18:25:37 +02:00
Erik Arvstedt 02f1599503 clightning-rest: 0.8.0 -> 0.9.0 2022-08-27 14:09:48 +02:00
Erik Arvstedt c3769014b1 rtl: 0.13.0 -> 0.13.1 2022-08-27 14:09:48 +02:00
Erik Arvstedt db3c0f0519 img/logo: add LICENSE 2022-08-26 10:22:29 +02:00
Erik Arvstedt 53dd2a1ae2 cl-rest: 0.7.2 -> 0.8.0
- Use `fetch-node-modules`
- Only use nodejs-slim as a runtime dependency
2022-08-21 19:11:51 +02:00
Erik Arvstedt 617ed4c8e8 rtl: 0.12.3-beta -> 0.13.0
- Use `fetch-node-modules` to remove the 4161 line file `node-packages.nix`
- Only use nodejs-slim as a runtime dependency
- Shrink package size by >500M by excluding certain dev-only dependencies
2022-08-21 19:11:51 +02:00
Erik Arvstedt e63dafe0f7 pkgs: add fetch-node-modules 2022-08-21 19:11:51 +02:00
Erik Arvstedt 321e8ba06e clightning: fix build 2022-08-21 10:23:33 +02:00
Erik Arvstedt 44561235b2 rtl: set explicit nodejs version 2022-08-21 10:23:33 +02:00
Erik Arvstedt f2cb5bfc10 update nixpkgs
nbxplorer: 2.3.28 -> 2.3.33
btcpayserver: 1.6.1 -> 1.6.9
charge-lnd: 0.2.4 -> 0.2.12
lightning-loop: 0.19.1-beta -> 0.20.0-beta
2022-08-21 10:23:33 +02:00
Erik Arvstedt 5eb01498d5 tests: add comment 2022-08-05 13:48:53 +00:00
Erik Arvstedt 952cd3773f run-tests: support tests with multiple VMs in run 2022-08-05 13:48:36 +00:00
Erik Arvstedt a3490dfc0f onion-services: don't propagate restart of onion-addresses to depending services
Currently, public services that publish their onion addresses have a
`requires` dependeny on service `onion-addresses`, so they are restarted
when `onion-addresses` restarts.

This has the downside that most of nix-bitcoin's services are restarted
when a new onion service is added and the system config has the following common settings:
- nix-bitcoin.onionServices.bitcoind.public = true
- nix-bitcoin.operator.enable = true

Sequence of events:
1. onion service is added
2. `onion-addresses` restarts, because the new onion service is made available to `operator`
3. bitcoind restarts
4. all depending services restart

Fix this by using a `wants` dependency.
2022-08-04 11:48:26 +02:00
Erik Arvstedt 7544c62970 readme: add nixos options search 2022-07-29 17:24:32 +02:00
Erik Arvstedt 9c5dbeaa83 test/nixos-search: fix wrong flake being tested
Now the test targets the main nix-bitcoin flake instead of the
nixos-search flake.

Also remove `NIX_PATH`, which is no longer required.
2022-07-22 17:41:31 +02:00
Erik Arvstedt 42bf0422e0 operator: fix syntax error in description
Fix error `Invalid XML` when running flake-info (nixos-search) .
2022-07-22 17:17:11 +02:00
Erik Arvstedt 7d5182298b examples/deploy-krops: fix missing secrets
Previously, `deploy-krops.sh` failed when run in a freshly cloned repo
due to missing secrets.
2022-07-22 16:24:24 +02:00
Erik Arvstedt 7a129a7e9c docs: improve Security Fund documentation
- Add to README
- Improve wording
2022-07-22 15:18:34 +02:00
Erik Arvstedt 0ba6c63670 secrets: fix sorting in setup-secrets
Now the bash globbing sort order equals the nix sort order
(order of `processedFiles`)
Previously, `comm` could fail with error `unsorted` on
specific secrets names.
2022-07-22 14:57:06 +02:00
Erik Arvstedt f12ea83d36 docs/install: fix formatting 2022-07-18 16:11:11 +02:00
Erik Arvstedt dad9679647 deployment shell: add command build-config 2022-07-17 22:17:48 +02:00
Erik Arvstedt 2926fc27dc krops: enable evaluating nodes with non-native systems 2022-07-17 22:17:48 +02:00
Erik Arvstedt fe2df830a2 flake: add system armv7l-linux
There are some ARMv7 single board computers that are capable of
running a bitcoin node (see https://nixos.wiki/wiki/NixOS_on_ARM).
2022-07-17 22:17:47 +02:00
Erik Arvstedt 84b69dfb46 versioning: improve description wording 2022-07-17 12:46:01 +02:00
Erik Arvstedt 8dc4858872 bitcoind: remove banlist loader
Gmaxwell's banlist (https://people.xiph.org/~greg/banlist.cli.txt) is
no longer maintained and hasn't been updated since 2 years.
2022-07-15 14:45:37 +02:00
Erik Arvstedt 9d20837b90 flake: remove rec 2022-07-15 11:42:13 +02:00
Erik Arvstedt c82e0ee294 clightning/plugins: format plugin defs, order alphabetically 2022-07-15 01:50:15 +02:00
Erik Arvstedt 9ac3d93b27 improve comments, descriptions 2022-07-15 01:50:11 +02:00
Erik Arvstedt 97b1a1d353 operator: improve descriptions 2022-07-14 23:47:12 +02:00
Erik Arvstedt 27dd31ead5 clightning/feeadjuster: fix typo 2022-07-14 23:46:25 +02:00
Erik Arvstedt df5abd5eab lnd: move wallet-unlock-password-file setting to config
There's no need to pass this option via the cmdline.
2022-07-14 23:46:25 +02:00
Erik Arvstedt 7d7f2df006 fulcrum: add module 2022-07-09 11:07:09 +02:00
Erik Arvstedt edd8bd311c bitcoind-rpc-public-whitelist: add ping, help
Required by fulcrum.
2022-07-08 15:10:03 +02:00
Erik Arvstedt f946a7cd9b examples: use mkDefault for setting system.stateVersion
This makes it easier for users to override the default.
2022-07-08 15:10:03 +02:00
Erik Arvstedt c853f380d4 lightning-loop: add certificate options extraIPs and extraDomains
This is useful for non-local access to the lightning-loop REST server.
2022-07-07 16:09:26 +02:00
Erik Arvstedt edfbe700e7 lnd: add certificate options extraIPs and extraDomains
This is useful for non-local access to the lnd REST server.
2022-07-07 16:09:26 +02:00
Erik Arvstedt 60a27d58a6 lnd, lightning-loop: improve extraConfig option description 2022-07-07 16:09:26 +02:00
Erik Arvstedt 79994d0bd2 tests: increase postgresql startup timeout
Required for Cirrus CI.
2022-07-07 11:43:21 +02:00