Commit Graph
29 Commits
Author SHA1 Message Date
Erik Arvstedt b90bf6691b add generate-secrets.service 2020-01-12 20:02:01 +01:00
Erik Arvstedt 6447694214 add generate-secrets pkg
generate-secrets.sh will also be used in generate-secrets.nix, so DRY
its dependency definitions.
2020-01-12 20:02:01 +01:00
Erik Arvstedt e34093a8ac generate_secrets.sh: add opensslConf option
Needed for the following commit.
2020-01-12 20:02:01 +01:00
Erik Arvstedt 9d14d5ba64 generate_secrets.sh: write secrets to working directory
Write to $PWD instead to ./secrets.
1. Simplifies the code
2. Easier to use in generate-secrets.service (introduced in a later commit)
2020-01-12 20:02:01 +01:00
Erik Arvstedt 51fb054001 generate_secrets.sh: extract makepw command
This makes it obvious that all passwords are generated with the same parameters
2020-01-12 20:02:01 +01:00
Erik Arvstedt e3b47ce18a add setup-secrets.service 2020-01-12 20:02:01 +01:00
Erik Arvstedt 437b268433 extract make-secrets.nix
Needed by the next commit.
2020-01-12 20:02:00 +01:00
Erik Arvstedt f9c29b9318 simplify secret definitions 2020-01-12 20:02:00 +01:00
Erik Arvstedt cd0fd6926b don't copy secret files to store during nixops deployment 2020-01-12 20:02:00 +01:00
Erik Arvstedt f0a36fe0c7 add 'nix-bitcoin-services' option
1. Makes the content easily accessible for module users
2. Avoids needlessly recalculating the attrset in every client module
2020-01-12 20:02:00 +01:00
Erik Arvstedt 7aaf30501c nix-bitcoin-services: simplify formatting 2020-01-09 10:43:30 +01:00
Erik Arvstedt 760da232e0 add nix-bitcoin pkgs namespace
Not polluting the main pkgs namespace with internal pkgs makes it
easier to integrate the nix-bitcoin modules into a larger config.

Also, by overriding the nix-bitcoin namespace, users can now easily set the
packages used by services that offer no explicit `package` option, like `clightning`.
2020-01-09 10:43:30 +01:00
Erik Arvstedt 6def181dbc add modules.nix
Importing modules.nix enables the stand-alone use of the modules, without the
config presets of nix-bitcoin.nix.
2020-01-09 10:43:29 +01:00
Erik Arvstedt 3b842e5fe7 add nix-bitcoin-secrets.target
Remove use of nixops-specific 'keys' group and key services.
Instead:
- Add nix-bitcoin-secrets.target, which should be required by all
  units that depend on secrets. (To keep it simple, it's okay to meet
  the secrets dependency indirectly by e.g. depending on bitcoind.)

  Various secret deployment methods can use this target by
  setting up the secrets before activating the target.
  In case of nixops we just specify that nixops' keys.target comes
  before nix-bitcoin-secrets.target.

  If the target is left undefined in the case of manual secrets
  deployment, systemd will simply ignore unit dependencies on
  the target.

- Allow all users to access the secrets dir.
  The access protection for the individual secret files is unchanged.
  This allows us to drop the unit dependency on the nixops 'keys' group.
2020-01-09 10:43:29 +01:00
Erik Arvstedt bbf2bbc04a network.nix: simplify import of main config 2020-01-09 10:43:29 +01:00
Erik Arvstedt 7e021a2629 simplify overlay.nix
Move pkg definitions to pkgs/default.nix.
This allows us to just import the pkgs in overlay.nix and get rid of
the filtering to exclude the modules.
2020-01-09 10:43:29 +01:00
Erik Arvstedt 07dc3e04ac move bitcoinrpc group definition to bitcoind
services.bitcoind has a strict dependency on the 'bitcoinrpc' group
via the 'bitcoin-rpcpassword' secret.
2019-11-27 14:05:19 +01:00
Erik Arvstedt d61b185c3a simplify user and group definitions 2019-11-27 14:05:19 +01:00
Erik Arvstedt c36c496507 banlist: fail on unexpected errors
Also, don't output the 'already banned' error message
2019-11-14 13:06:21 +01:00
Erik Arvstedt e0276503ed fixup! ignore banlist errors (like in master) 2019-11-14 13:04:42 +01:00
Erik Arvstedt d64156e485 banlist: don't wait in preStart until bitcoind is ready
preStart is meant for short-run scripts, but bitcoind can take a long
time until it accepts commands, especially on low-powered systems.

Fixes #122
2019-11-12 19:59:06 +01:00
Erik Arvstedt d87c50a305 banlist: simplify unit, bind to bitcoind, fix wantedBy
Type = "simple" is the default unit type.

Being wanted by bitcoind instead of a system target is more appropriate.

By binding to bitcoind, the service is automatically stopped when
bitcoind exits. This eliminates the bitcoind liveness check in preStart.
2019-11-12 19:44:44 +01:00
Erik Arvstedt 39885d37c1 banlist: simplify script, remove package
We're now directly using Greg's unmodified banlist which
simplifies the update process.

The banlist package with its dependency on the bitcoin datadir path is only
relevant for internal use within nix-bitcoin, so we can safely remove
it.

We're now using the bitcoin-cli from `services.bitcoind.package`.

Fixes #129
2019-11-12 19:42:33 +01:00
Erik Arvstedt 55e73f32e3 bitcoind: add cli option 2019-11-12 19:41:29 +01:00
Erik Arvstedt 8807b9f6b2 bitcoind: remove 'StateDirectory'
This option is useless because we're doing our own state dir management
via 'dataDir'.
2019-11-12 19:41:29 +01:00
Erik Arvstedt 46edb39d2f Add content hashes for pinned channels 2019-11-11 18:45:17 +01:00
Erik Arvstedt 961e8217a9 Rename contrib/ to helper/ 2019-11-11 18:45:17 +01:00
Erik Arvstedt cfafcb5d32 Fix virtualbox deployment for 19.09
Without this, starting the virtualbox guest service fails during machine activation.
This is due to an incompatible NixOS machine base image.
Fix this by using an updated version of nixops.
2019-11-10 21:06:17 +01:00
Erik Arvstedt 6e26453689 Set default size of the virtualbox machine disk
This eliminates the manual resize step in vbox deployment
2019-11-08 16:01:47 +01:00