2018-11-14 02:44:54 +03:00
|
|
|
|
# Edit this configuration file to define what should be installed on
|
|
|
|
|
# your system. Help is available in the configuration.nix(5) man page
|
|
|
|
|
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
|
|
|
|
|
2020-02-23 22:30:32 +03:00
|
|
|
|
{ config, pkgs, lib, ... }: {
|
2019-04-14 21:38:34 +03:00
|
|
|
|
imports = [
|
2020-02-26 19:11:20 +03:00
|
|
|
|
<nix-bitcoin/modules/nix-bitcoin.nix>
|
|
|
|
|
|
2020-02-26 19:11:21 +03:00
|
|
|
|
# FIXME: The hardened kernel profile improves security but
|
|
|
|
|
# decreases performance by ~50%.
|
|
|
|
|
# Turn it off when not needed.
|
|
|
|
|
# Source: https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/profiles/hardened.nix
|
|
|
|
|
<nixpkgs/nixos/modules/profiles/hardened.nix>
|
2019-04-27 15:19:56 +03:00
|
|
|
|
|
2018-12-28 16:44:32 +03:00
|
|
|
|
# FIXME: Uncomment next line to import your hardware configuration. If so,
|
|
|
|
|
# add the hardware configuration file to the same directory as this file.
|
2019-01-02 17:56:57 +03:00
|
|
|
|
# This is not needed when deploying to a virtual box.
|
2018-12-11 02:24:47 +03:00
|
|
|
|
#./hardware-configuration.nix
|
2018-12-06 18:59:41 +03:00
|
|
|
|
];
|
2019-04-12 11:47:49 +03:00
|
|
|
|
# FIXME: Enable modules by uncommenting their respective line. Disable
|
|
|
|
|
# modules by commenting out their respective line. Enable this module to
|
|
|
|
|
# use the nix-bitcoin node configuration. Only disable this if you know what
|
|
|
|
|
# you are doing.
|
|
|
|
|
services.nix-bitcoin.enable = true;
|
2019-04-12 12:01:40 +03:00
|
|
|
|
|
2020-02-23 22:30:32 +03:00
|
|
|
|
### BITCOIND
|
|
|
|
|
# Bitcoind is enabled by default if nix-bitcoin is enabled
|
|
|
|
|
#
|
|
|
|
|
# You can override default settings from nix-bitcoin.nix as follows
|
|
|
|
|
# services.bitcoind.prune = lib.mkForce 100000;
|
|
|
|
|
#
|
|
|
|
|
# You can add options that are not defined in modules/bitcoind.nix as follows
|
|
|
|
|
# services.bitcoind.extraConfig = ''
|
|
|
|
|
# maxorphantx=110
|
|
|
|
|
# '';
|
|
|
|
|
|
2019-04-12 12:01:40 +03:00
|
|
|
|
### CLIGHTNING
|
2019-04-12 11:47:49 +03:00
|
|
|
|
# Enable this module to use clightning, a Lightning Network implementation
|
|
|
|
|
# in C.
|
|
|
|
|
services.clightning.enable = true;
|
2019-04-12 12:01:40 +03:00
|
|
|
|
# Enable this option to listen for incoming lightning connections. By
|
|
|
|
|
# default nix-bitcoin nodes offer outgoing connectivity.
|
|
|
|
|
# services.clightning.autolisten = true;
|
|
|
|
|
|
2019-08-05 11:44:38 +03:00
|
|
|
|
### LND
|
|
|
|
|
# Disable clightning and uncomment the following line in order to enable lnd,
|
|
|
|
|
# a lightning implementation written in Go.
|
|
|
|
|
# services.lnd.enable = assert (!config.services.clightning.enable); true;
|
2019-08-25 02:24:26 +03:00
|
|
|
|
## WARNING
|
|
|
|
|
# If you use lnd, you should manually backup your wallet mnemonic
|
|
|
|
|
# seed. This will allow you to recover on-chain funds. You can run the
|
|
|
|
|
# following command after the lnd service starts:
|
2019-08-05 11:44:38 +03:00
|
|
|
|
# nixops scp --from bitcoin-node /secrets/lnd-seed-mnemonic ./secrets/lnd-seed-mnemonic
|
2019-08-25 02:24:26 +03:00
|
|
|
|
# You should also backup your channel state after opening new channels.
|
|
|
|
|
# This will allow you to recover off-chain funds, by force-closing channels.
|
|
|
|
|
# nixops scp --from bitcoin-node /var/lib/lnd/chain/bitcoin/mainnet/channel.backup /my-backup-path/channel.backup
|
2019-08-05 11:44:38 +03:00
|
|
|
|
|
2019-04-12 12:01:40 +03:00
|
|
|
|
### SPARK WALLET
|
|
|
|
|
# Enable this module to use spark-wallet, a minimalistic wallet GUI for
|
|
|
|
|
# c-lightning, accessible over the web or through mobile and desktop apps.
|
|
|
|
|
# Only enable this if clightning is enabled.
|
|
|
|
|
# services.spark-wallet.enable = true;
|
|
|
|
|
|
|
|
|
|
### ELECTRS
|
|
|
|
|
# Enable this module to use electrs, an efficient re-implementation of
|
2019-05-13 18:13:23 +03:00
|
|
|
|
# Electrum Server in Rust. Only enable this if hardware wallets are
|
2019-05-10 18:37:32 +03:00
|
|
|
|
# disabled.
|
2019-04-12 12:01:40 +03:00
|
|
|
|
# services.electrs.enable = true;
|
2019-08-07 14:03:34 +03:00
|
|
|
|
# If you have ≥8GB memory, enable this option so electrs will sync faster.
|
|
|
|
|
# services.electrs.high-memory = true;
|
2019-04-12 12:01:40 +03:00
|
|
|
|
|
|
|
|
|
### LIQUIDD
|
2019-08-05 18:11:27 +03:00
|
|
|
|
# Enable this module to use Liquid, a sidechain for an inter-exchange
|
2019-04-12 12:01:40 +03:00
|
|
|
|
# settlement network linking together cryptocurrency exchanges and
|
2019-08-05 18:11:27 +03:00
|
|
|
|
# institutions around the world. Liquid is accessed with the elements-cli
|
|
|
|
|
# tool run as user operator.
|
2019-08-06 14:55:19 +03:00
|
|
|
|
# services.liquidd.enable = true;
|
2019-04-12 12:01:40 +03:00
|
|
|
|
|
|
|
|
|
### LIGHTNING CHARGE
|
2019-04-12 11:47:49 +03:00
|
|
|
|
# Enable this module to use lightning-charge, a simple drop-in solution for
|
|
|
|
|
# accepting lightning payments. Only enable this if clightning is enabled.
|
2019-04-12 12:01:40 +03:00
|
|
|
|
# services.lightning-charge.enable = true;
|
|
|
|
|
|
|
|
|
|
### NANOPOS
|
2019-04-12 11:47:49 +03:00
|
|
|
|
# Enable this module to use nanopos, a simple Lightning point-of-sale
|
|
|
|
|
# system, powered by Lightning Charge. Only enable this if clightning and
|
|
|
|
|
# lightning-charge are enabled.
|
2019-04-12 12:01:40 +03:00
|
|
|
|
# services.nanopos.enable = true;
|
|
|
|
|
|
|
|
|
|
### WEBINDEX
|
2019-04-12 11:47:49 +03:00
|
|
|
|
# Enable this module to use the nix-bitcoin-webindex, a simple website
|
|
|
|
|
# displaying your node information and link to nanopos store. Only enable
|
|
|
|
|
# this if clightning, lightning-charge, and nanopos are enabled.
|
2019-04-12 12:01:40 +03:00
|
|
|
|
# services.nix-bitcoin-webindex.enable = true;
|
2019-01-01 22:16:24 +03:00
|
|
|
|
|
2019-04-14 19:55:40 +03:00
|
|
|
|
### RECURRING-DONATIONS
|
2019-04-22 03:38:46 +03:00
|
|
|
|
# Enable this module to send recurring donations. This is EXPERIMENTAL; it's
|
|
|
|
|
# not guaranteed that payments are succeeding or that you will notice payment
|
|
|
|
|
# failure. Only enable this if clightning is enabled.
|
2019-04-14 19:55:40 +03:00
|
|
|
|
# services.recurring-donations.enable = true;
|
|
|
|
|
# Specify the receivers of the donations. By default donations are every
|
2019-04-22 20:39:15 +03:00
|
|
|
|
# Monday at a randomized time. Check `journalctl -eu recurring-donations` or
|
|
|
|
|
# `lightning-cli listpayments` for successful lightning donations.
|
2019-04-14 19:55:40 +03:00
|
|
|
|
# services.recurring-donations.tallycoin = {
|
2019-04-22 20:39:15 +03:00
|
|
|
|
# "<receiver name>" = <amount you wish to donate in sat>"
|
|
|
|
|
# "<additional receiver name>" = <amount you wish to donate in sat>;
|
2019-04-14 19:55:40 +03:00
|
|
|
|
# "djbooth007" = 1000;
|
|
|
|
|
# };
|
|
|
|
|
|
2019-04-29 23:39:25 +03:00
|
|
|
|
### Hardware wallets
|
|
|
|
|
# Enable this module to allow using hardware wallets. See https://github.com/bitcoin-core/HWI
|
2019-05-10 18:37:32 +03:00
|
|
|
|
# for more information. Only enable this if electrs is disabled.
|
2019-04-29 23:39:25 +03:00
|
|
|
|
# Ledger must be initialized through the official ledger live app and the Bitcoin app must
|
|
|
|
|
# be installed and running on the device.
|
|
|
|
|
# services.hardware-wallets.ledger = true;
|
2019-05-13 18:13:23 +03:00
|
|
|
|
# Trezor can be initialized with the trezorctl command in nix-bitcoin. More information in
|
|
|
|
|
# `docs/usage.md`.
|
2019-04-29 23:39:25 +03:00
|
|
|
|
# services.hardware-wallets.trezor = true;
|
|
|
|
|
|
2019-01-01 22:16:24 +03:00
|
|
|
|
# FIXME: Define your hostname.
|
|
|
|
|
networking.hostName = "nix-bitcoin";
|
|
|
|
|
time.timeZone = "UTC";
|
|
|
|
|
|
2018-12-28 16:44:32 +03:00
|
|
|
|
# FIXME: Add your SSH pubkey
|
2019-01-01 22:16:24 +03:00
|
|
|
|
services.openssh.enable = true;
|
2018-12-28 16:44:32 +03:00
|
|
|
|
users.users.root = {
|
|
|
|
|
openssh.authorizedKeys.keys = [ "" ];
|
|
|
|
|
};
|
|
|
|
|
|
2019-01-01 22:16:24 +03:00
|
|
|
|
# FIXME: add packages you need in your system
|
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
|
vim
|
|
|
|
|
];
|
|
|
|
|
|
2019-01-16 02:07:32 +03:00
|
|
|
|
# FIXME: Add custom options (like boot options, output of
|
|
|
|
|
# nixos-generate-config, etc.):
|
2018-12-28 16:44:32 +03:00
|
|
|
|
|
2019-04-27 15:19:56 +03:00
|
|
|
|
# If the hardened profile is imported above, we need to explicitly allow
|
|
|
|
|
# user namespaces to enable sanboxed builds and services.
|
|
|
|
|
security.allowUserNamespaces = true;
|
|
|
|
|
|
2019-01-01 22:16:24 +03:00
|
|
|
|
# This value determines the NixOS release with which your system is to be
|
|
|
|
|
# compatible, in order to avoid breaking some software such as database
|
|
|
|
|
# servers. You should change this only after NixOS release notes say you
|
|
|
|
|
# should.
|
|
|
|
|
system.stateVersion = "18.09"; # Did you read the comment?
|
2018-11-14 02:44:54 +03:00
|
|
|
|
}
|