Commit Graph
100 Commits
Author SHA1 Message Date
Erik Arvstedt f17fcebe11 nodeinfo: make extensible
Module authors can now add extra services via option `nix-bitcoin.nodeinfo.services`.
Mark as internal because we're not yet providing a user-friendly, stable API.
2022-07-05 10:11:55 +02:00
Erik Arvstedt fe68ee650b fix containers on nixos-22.05 2022-06-28 00:09:26 +02:00
Erik Arvstedt 15e7b32c2d fix VMs on nixos-22.05 2022-06-28 00:09:26 +02:00
Erik Arvstedt f52ff8fdb5 fix python packages on nixos-22.05
Fixes:
- joinmarket
- pyln-proto
2022-06-28 00:09:26 +02:00
Erik Arvstedt a9123a9842 lndinit: update vendorSha256 2022-06-28 00:09:25 +02:00
Erik Arvstedt 3102c99275 configuration.nix: update system.stateVersion 2022-06-28 00:09:25 +02:00
Erik Arvstedt 2106a2cdea spark-wallet/generate.sh: remove TODO-EXTERNAL
It makes sense in general to explicitly set the nodejs version.
2022-06-28 00:09:25 +02:00
Erik Arvstedt 96144fde81 update-flake.nix: fix stable pkgs selection
In rare cases, the nixpkgs stable version of a package can be newer
than in unstable nixpkgs. [1]
When this happens, choose the newer stable version instead of the
older unstable version.

[1] E.g., when a package is updated in both nixpkgs stable and unstable,
and nixpkgs stable is released before unstable.
2022-06-27 22:19:06 +02:00
Erik Arvstedt c8d5cb2405 examples: improve Flakes-based VM
- Show login message
- Poweroff on shell exit
- Move to top of examples/README
2022-06-02 14:06:54 +02:00
Erik Arvstedt cbf327c808 lndconnect-onion: fix for custom operator names 2022-06-02 12:38:33 +02:00
Erik Arvstedt 1e94e891b2 flake: move VM to separate file
This simplifies the flake.
2022-06-01 22:12:50 +02:00
Erik Arvstedt 7233b054d9 flake: use new output format
The previous format is deprecated.
2022-06-01 22:12:47 +02:00
Erik Arvstedt f9315db52c clightning/feeadjuster: add test 2022-05-27 11:22:00 +02:00
Erik Arvstedt ae94665ad1 clightning: add package option 2022-05-22 15:57:15 +02:00
Erik Arvstedt 041162d1e3 clightning-plugins: update to latest rev 2022-05-22 15:57:15 +02:00
Erik Arvstedt ef93a9a8bd rtl: formatting 2022-05-20 13:28:45 +02:00
Erik Arvstedt 571983a993 docs/services: improve lndconnect section 2022-05-20 13:28:45 +02:00
Erik Arvstedt 9649785dd5 docs/configuration: improve formatting
Join paragraphs that refer to the same topic.
2022-05-20 13:28:44 +02:00
Erik Arvstedt 3d32c0afeb docs/configuration: clarify description
It's not entirely clear what 'updating the secrets' means (it refers to
the previous step), so just remove this part.
2022-05-20 13:28:44 +02:00
Erik Arvstedt 107ee27be3 docs/configuration: improve wording 2022-05-20 13:28:44 +02:00
Erik Arvstedt e2721a9039 examples/configuration.nix: update system.stateVersion 2022-05-20 13:28:42 +02:00
Erik Arvstedt 15288d58e1 lnd: rename var mnemonic -> seed
This matches lnd's terminology.
2022-05-17 13:19:38 +02:00
Erik Arvstedt 84fe731c94 treewide: curl: exit with error status on HTTP errors
This makes scripts fail early on request errors.
Previously, curl exited with status 0 when enountering HTTP error status
codes.
`-fsS` equals `--fail --silent --show-error`.
2022-05-17 13:19:38 +02:00
Erik Arvstedt 63b3eec9cd push-release.sh: fix pushing to master branch 2022-05-17 13:19:37 +02:00
Erik Arvstedt 3755b3ebea rtl: add option extraConfig for nodes
Also define rtl config as a Nix attrset that is converted to JSON
2022-05-15 21:25:32 +02:00
Erik Arvstedt ff228a604d rtl: change nodes options
- Move option `rtl.nodes.{lnd,clightning}` -> `rtl.nodes.{lnd,clightning}.enable`
  This is required by the next commit.

- Move option `rtl.loop` -> `rtl.nodes.lnd.loop`

- Only enable loop when `nodes.lnd` is enabled
2022-05-15 21:25:32 +02:00
Erik Arvstedt beae9f8df7 clightning-rest: 0.7.0 -> 0.7.2 2022-05-14 15:22:35 +02:00
Erik Arvstedt 4c2d908a38 rtl: 0.12.2-beta -> 0.12.3-beta 2022-05-14 15:22:35 +02:00
Erik Arvstedt 472bcf1565 pkgs-unstable: inherit system from stable pkgs
Previously, `builtins.defaultSystem` was implicitly used.
This fixes NixOS system builds for systems other than `defaultSystem`.
2022-05-11 10:04:55 +02:00
Erik Arvstedt e6bb281a88 services: set systemd list options as list values
This makes our list definitions mergeable with custom list values
set by users.
Previously, a module error ("value is a string while a list
was expected") was thrown instead.

This commit was partly auto-generated with this script:

#!/usr/bin/env ruby
Dir["**/*.nix"].each do |file|
  src = File.read(file)
  fixed = src.gsub(/ReadWritePaths *= *(.*?);/) do
    "ReadWritePaths = [ #{$1} ];"
  end
  File.write(file, fixed) if fixed != src
end
2022-05-07 20:37:02 +02:00
Erik Arvstedt 4b800605e0 add release branch
Use this as the default in the example flake.
2022-05-06 16:49:31 +02:00
Erik Arvstedt 8e1ad6e3a8 docs/services: update Zeus usage section, add clightning
The current Zeus version has native tor support, so Orbot is no longer required.
2022-05-06 16:26:40 +02:00
Erik Arvstedt 20c0194ade readme: add hint about github table of contents button 2022-05-06 16:26:40 +02:00
Erik Arvstedt e2fee4bf1a lnd-rest-onion-service.nix: move to lndconnect-onion.nix, add clightning support
Option `services.lnd.restOnionService.package` has been removed.
There's not much use in overriding the [lndconnect pkg](https://github.com/LN-Zap/lndconnect).
2022-05-06 16:26:40 +02:00
Erik Arvstedt acf5fe69ad add standalone clightning-rest service
- Rename `services.rtl.cl-rest` to `services.clightning-rest`.
  `clightning-rest` is generally useful for connecting external REST clients
  to clightning.

- Add a dedicated network namespace in netns-isolation.

- Add nodeinfo entry.

- Add datadir (which contains REST auth data) to backups.
2022-05-06 16:26:40 +02:00
Erik Arvstedt c30aa33c15 cl-rest: rename pkg to clightning-rest 2022-05-06 16:24:59 +02:00
Erik Arvstedt f234e59ca5 nbPython3Packages: fix clightning pkgs
Also enable tests for the pyln-* pkgs.
2022-05-06 13:36:06 +00:00
Erik Arvstedt 900836fe0d joinmarket: add private python package set
This is a nonfunctional refactoring commit.

It's needed because pkg `pyln-proto`, which is introduced in the next commit,
requires a different, incompatible version of `cryptography`, which
must be placed in a different python package set.
2022-05-06 13:35:32 +00:00
Erik Arvstedt ca834cce84 joinmarket: simplify pkgs
Remove unused dependencies.
2022-05-06 13:35:32 +00:00
Erik Arvstedt 408486ac9c tests: update nbxplorer 2022-05-06 13:35:28 +00:00
Erik Arvstedt aa21fb454e tests: disable btcpayserver.lbtc for regtest
Previously, in case of btcpayserver.lbtc on regtest, nbxplorer just
printed a log error while trying to generate liquidd regtest blocks.
Now nbxplorer exits with an error, so disable lbtc.
2022-05-06 13:35:27 +00:00
Erik Arvstedt 7de56b019f nbxplorer: use postgresql
The former DBTrie backend has been deprecated.
2022-05-06 13:35:27 +00:00
Erik Arvstedt 29d2ffc111 defaultHardening: allow clone3 system call
clone3 is the latest version of the clone system call, which is already
allowed.
clone3 is required by nbxplorer 2.3.20.
2022-05-06 13:35:23 +00:00
Erik Arvstedt 66b19403a6 clboss: fix clboss being enabled by default 2022-05-05 16:58:16 +02:00
Erik Arvstedt dd2dcad3dc clboss: 0.11E -> 0.12 2022-04-30 13:08:50 +02:00
Erik Arvstedt f08b83bce2 clboss: update module 2022-04-26 12:04:32 +02:00
Erik Arvstedt 3b4cf665e8 clboss: 0.11B -> 0.11E 2022-04-26 11:34:05 +02:00
Erik Arvstedt a4a5c72b01 lnd: use lndinit for wallet creation 2022-04-04 13:59:36 +02:00
Erik Arvstedt e793a3470c lndinit: init at 0.1.3-beta 2022-04-04 13:59:36 +02:00
Erik Arvstedt 77b34954ef cl-rest: 0.6.1 -> 0.7.0 2022-03-29 16:30:47 +02:00
Erik Arvstedt 91203d8d06 secrets: fix secrets setup warning
With newer nixpkgs versions, a type error was shown instead of the
warning message when `secretsSetupMethod` was unset.
2022-03-11 01:34:47 +01:00
Erik Arvstedt 2493c8c201 liquidd: add service timeouts like in bitcoind
Previously, liquidd could fail with error:
liquidd.service: start operation timed out. Terminating.
2022-02-28 14:01:54 +01:00
Erik Arvstedt 59bf0274c0 pkgs: add groups, sort alphabetically 2022-02-28 14:00:23 +01:00
Erik Arvstedt 0bede274a8 clightning-plugins/commando: add module 2022-02-24 08:31:54 -08:00
Erik Arvstedt 1af84e8b7e makeShell: use actual system configuration in generate-secrets
This fixes a bug where the version update message for v0.0.65 is erroneously triggered
because the krops config is not included when evaluating secrets.
2022-02-12 21:33:23 +01:00
Erik Arvstedt d959d5b558 secure-node: don't set nix-bitcoin.secretsDir
This simplifies the docs and the secure-node module.

This change doesn't affect users that deploy via krops.
2022-02-05 21:35:50 +01:00
Erik Arvstedt 7b0c3d48c9 docs/services.md: link to clightning plugin list
The old list was incomplete.

Also update configuration.nix.
2022-02-05 21:34:10 +01:00
Erik Arvstedt 7402212263 examples/configuration.nix: disable passwordAuthentication
This is a sensible default.

Also clarify the pubkey setup.
2022-02-05 21:34:09 +01:00
Erik Arvstedt e093bb64d9 examples/configuration.nix: fix links to docs/services.md 2022-02-05 21:34:09 +01:00
Erik Arvstedt d41a550355 fetch-release: export GNUPGHOME
This approach is less error-prone.
It is also used by our fetcher scripts.
2022-02-05 21:33:54 +01:00
Erik Arvstedt 397b372cf3 bitcoind: improve option rpc.users
- Move description to top
- Improve example
2022-02-03 20:47:25 +01:00
Erik Arvstedt 679e7b6544 bitcoind: remove unneeded tmpfile rule 2022-02-03 20:47:25 +01:00
Erik Arvstedt 98f419233f bitcoind: don't log timestamps
Timestamps are already logged via journald.
2022-02-03 20:47:25 +01:00
Erik Arvstedt 6f8b4d9ebe flake: optimize nixpkgs importing
`nixpkgs.legacyPackages.${system}` allows reusing a single pkgs instance
that is shared among all flakes with the same `nixpkgs` input.
This is relevant when a user overrides the `nixpkgs` input of our flake
or exports our `nixpkgs` input to other flakes.
`import nixpkgs` would create a new pkgs instance instead.
2022-02-03 20:47:25 +01:00
Erik Arvstedt 16e2d4c8b7 flake: remove unneeded indirection in legacyPackages
Example: The nix-bitcoin electrs pkg can now be reached via flake attr
.#modulesPkgs.electrs
instead of
.#nbPkgs.modulesPkgs.electrs
2022-02-03 20:47:24 +01:00
Erik Arvstedt d8af0aca02 lnd: improve service initialization
- Use systemd startup notification.
- Use new option `--wallet-unlock-password-file` instead of
  manual unlocking.
2022-01-15 22:49:05 +01:00
Erik Arvstedt bf92d6094d bitcoind: fix error when defining passwordHMAC for RPC users 2022-01-07 03:32:07 +01:00
Erik Arvstedt 98bc0917d7 run-tests: fix vm cmd
Previously, qemu failed with error
`restrict=on : Parameter 'restrict' expects 'on' or 'off'`
due to the trailing space after `on`.
2022-01-04 22:30:35 +01:00
Erik Arvstedt 53a9f136b9 lib: allow syscall get_mempolicy in default seccomp filter
This syscall is required by an upcoming version of btcpayserver.
Because it is generally safe, we can allow it for all services.
2022-01-01 20:13:42 +00:00
Erik Arvstedt 6be3fb3e77 flake: provide a single NixOS module
Instead of providing two NixOS modules (one for using system pkgs,
one for using locked pkgs), provide a single module with option
`useVersionLockedPkgs`.

This fixes that all nix-bitcoin options are displayed twice
on search.nixos.org:
https://search.nixos.org/flakes?type=options&query=clightning
2021-12-27 16:59:14 +01:00
Erik Arvstedt d69524143b flake: remove nonstandard top-level flake attrs
Silences warnings in `nix flake check`.

- Define `mkNbPkgs` under attr `lib`.
  `lib` still triggers a warning, but it is expected to be a standard
  flake attr in a future Nix release.

- Define `nbPkgs` under attr `legacyPackages`.
  This also has the advantage to make its contents more easily
  accessible via the nix CLI. Example:
  nix eval nix-bitcoin#nbPkgs.modulesPkgs.clightning.version
2021-12-27 16:59:14 +01:00
Erik Arvstedt a31d07d8bf ci: update container image for modules tests
nixos/nix:latest has switched to Nix 2.5, but we should track
2.3.x, the default on NixOS stable.
2021-12-15 15:44:56 +01:00
Erik Arvstedtandnixbitcoin bc7d3a2ed7 fetch-release: check that only one key is imported
Co-authored-by: nixbitcoin <nixbitcoin@i2pmail.org>
2021-12-15 15:44:55 +01:00
Erik Arvstedt 5ab85cb2a5 pkgs: add meta attr
Also add more detailed `enable` option descriptions.
2021-12-15 14:39:31 +01:00
Erik Arvstedt 602281b132 rtl, cl-rest: add /bin to pkg output 2021-12-15 10:58:04 +01:00
Erik Arvstedt f4872f3334 spark-wallet: use node package lockfile 2021-12-15 10:58:04 +01:00
Erik Arvstedt 3091b0a4fb cl-rest: use node package lockfile 2021-12-15 10:58:04 +01:00
Erik Arvstedt fbfb61210a rtl: use node package lockfile 2021-12-15 10:58:04 +01:00
Erik Arvstedt d296b2d1fb charge-lnd: remove unneeded use of literalExample 2021-12-15 10:58:04 +01:00
Erik Arvstedt f13ffe0146 run-tests: make nixosSearch compatible with --copy-src 2021-12-15 10:58:04 +01:00
Erik Arvstedt 2069f62abc krops: -> 1.26.2
Includes https://github.com/krebs/krops/commit/9fc8cbf8e826d4c8a118f37202ab3f335341082a

Add krops/fetch-release.sh
2021-12-14 19:52:17 +01:00
Erik Arvstedt 5e59c784ed flake: remove internal pkg netns-exec from packages 2021-12-12 16:21:12 +01:00
Erik Arvstedt 1ef40ac230 ci: add flake test
- Check flake
- Check nixos-search doc generation
2021-12-12 16:21:12 +01:00
Erik Arvstedt d3c8d7bd6f .cirrus.yml: refactor
Required by the following commit.
2021-12-12 16:21:12 +01:00
Erik Arvstedt 26a53f0d59 ci: simplify test
Remove obsolete features that were required for pkgsUnstable.
2021-12-12 16:21:11 +01:00
Erik Arvstedt 0fd3be5343 move ci/ to test/ 2021-12-12 16:21:11 +01:00
Erik Arvstedt eaf98f92db test: add test nixosSearch
This checks that creating module docs for search.nixos.org succceeds.
Errors can happen when complex `default` values can't be evaluated
or on malformed Docbook XML in descriptions.
2021-12-12 16:21:02 +01:00
Erik Arvstedt 77d8c00c53 run-tests.sh: extract checkFlakeSupport
Required by the following commit.
2021-12-12 16:20:40 +01:00
Erik Arvstedt 96df81a4d0 run-tests: move flake next to other tests 2021-12-12 16:20:40 +01:00
Erik Arvstedt bbebd0b383 treewide: remove invalid docbook XML from option descriptions
NixOS will soon use CommonMark Markdown for option descriptions.
We can then switch back the old, slightly clearer bracket syntax.
2021-12-12 16:20:40 +01:00
Erik Arvstedt 3681f118f7 nix-bitcoin.nix: add defaultText (automatic)
This enables generating module option documentation.

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

def add_default_text(file)
  src = File.read(file)
  src2 = src.gsub(/( = mkOption\s+\{[^{]*?)(\n\s+default = )(.*?);$(.*?\})/m) do |str|
    pre, defaultVar, default, post = Regexp.last_match.captures
    replacement =
      if !post.include?('defaultText =')
        if default =~ /\bpkgs\b/
          defaultText = default.lines.length == 1 ? default : "(See source)"
          "#{pre}#{defaultVar}#{default};#{defaultVar.sub('default', 'defaultText')}#{defaultText.inspect};#{post}"
        end
      end
    replacement or str
  end
  File.write(file, src2) if src2 != src
end

Dir["modules/**/*.nix"].each do |f|
  next if File.basename(f) == "nix-bitcoin.nix"
  add_default_text f
end
2021-12-12 16:20:39 +01:00
Erik Arvstedt d24c029435 treewide: add defaultText (manual)
This enables generating module option documentation.

Add `defaultText` to options where the default value can't be
evaluated during metadata generation.
2021-12-12 16:18:14 +01:00
Erik Arvstedt f0096371bf btcpayserver: expand nbPkgs in option defaults
Required by commit `nix-bitcoin.nix: add `defaultText` (automatic)`.
2021-12-11 13:27:51 +01:00
Erik Arvstedt 349f904e79 secrets: use assertion instead of error in default value
This enables generating module option documentation.
2021-12-11 13:27:48 +01:00
Erik Arvstedt 2f0f1ec15a hardened-extended: define kernelParams as separate strings
This is now checked by the modules.
2021-12-10 12:16:31 +00:00
Erik Arvstedt 71e9864060 netns-isolation: add compatibility with 21.11
`security.wrappers` now requires `group` be defined.
2021-12-10 12:16:09 +00:00
Erik Arvstedt 8f641756ce tests: add TODO-EXTERNAL 2021-12-10 12:15:36 +00:00
Erik Arvstedt b2f7a80f9f tests: add compatibility with 21.11
Adapt to the new test driver and systemd versions.
2021-12-10 12:15:20 +00:00
Erik Arvstedt 6b539627ee add presets/bitcoind-remote.nix
This simplifies integrating a remote bitcoind instance and
makes `bitcoin-cli` work with the remote node.

Add note regarding `whitelistedPort` to docs.
2021-12-07 15:35:33 +01:00
Erik Arvstedt 5915a34891 configuration.md: fixes
- Fix firewall.allowedTCPPorts settings

- Section `Allow bitcoind RPC connections`:
  Set catch-all listen for `rpc.address` instead of `address`.

- rpc.allowip: Set subnet zero to fix allowing all addresses
2021-12-07 15:35:33 +01:00