From df5abd5eab9755da2930ca86ccbff6fda2c0c35c Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Thu, 14 Jul 2022 23:45:24 +0200 Subject: [PATCH 1/7] lnd: move `wallet-unlock-password-file` setting to config There's no need to pass this option via the cmdline. --- modules/lnd.nix | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/modules/lnd.nix b/modules/lnd.nix index 8e57a1f..7d99641 100644 --- a/modules/lnd.nix +++ b/modules/lnd.nix @@ -178,6 +178,8 @@ let bitcoind.zmqpubrawblock=${bitcoind.zmqpubrawblock} bitcoind.zmqpubrawtx=${bitcoind.zmqpubrawtx} + wallet-unlock-password-file=${secretsDir}/lnd-wallet-password + ${cfg.extraConfig} ''; in { @@ -249,11 +251,7 @@ in { Type = "notify"; RuntimeDirectory = "lnd"; # Only used to store custom macaroons RuntimeDirectoryMode = "711"; - ExecStart = '' - ${cfg.package}/bin/lnd \ - --configfile="${cfg.dataDir}/lnd.conf" \ - --wallet-unlock-password-file="${secretsDir}/lnd-wallet-password" - ''; + ExecStart = "${cfg.package}/bin/lnd --configfile='${cfg.dataDir}/lnd.conf'"; User = cfg.user; TimeoutSec = "15min"; Restart = "on-failure"; From 27dd31ead516fef082417122b8f8ffe6daad976e Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Thu, 14 Jul 2022 23:45:25 +0200 Subject: [PATCH 2/7] clightning/feeadjuster: fix typo --- modules/clightning-plugins/feeadjuster.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/clightning-plugins/feeadjuster.nix b/modules/clightning-plugins/feeadjuster.nix index 2ec4859..7e7c905 100644 --- a/modules/clightning-plugins/feeadjuster.nix +++ b/modules/clightning-plugins/feeadjuster.nix @@ -10,7 +10,7 @@ let Enable feeaduster (clightning plugin). This plugin auto-updates channel fees to keep channels balanced. - See here for for all available options: + See here for all available options: https://github.com/lightningd/plugins/blob/master/feeadjuster/feeadjuster.py Extra options can be set via `services.clightning.extraConfig`. ''; From 97b1a1d353930679b412ea4b398fda4220851251 Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Thu, 14 Jul 2022 23:45:26 +0200 Subject: [PATCH 3/7] operator: improve descriptions --- modules/operator.nix | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/modules/operator.nix b/modules/operator.nix index 627f8d1..bbf5a85 100644 --- a/modules/operator.nix +++ b/modules/operator.nix @@ -1,24 +1,29 @@ -# Define an operator user for convenient interactive access to nix-bitcoin -# features and services. -# -# When using nix-bitcoin as part of a larger system config, set -# `nix-bitcoin.operator.name` to your main user name. - { config, lib, pkgs, ... }: with lib; let options.nix-bitcoin.operator = { - enable = mkEnableOption "operator user"; + enable = mkOption { + type = types.bool; + default = false; + description = '' + Whether to define a user named `operator` for convenient interactive access + to nix-bitcoin features (like `bitcoin-cli`). + + When using nix-bitcoin as part of a larger system config, it makes sense + to set your main system user as the operator, by setting option + `nix-bitcoin.operator.name = "
";`. + ''; + }; name = mkOption { type = types.str; default = "operator"; - description = "User name."; + description = "Name of the operator user."; }; groups = mkOption { type = with types; listOf str; default = []; - description = "Extra groups."; + description = "Extra groups of the operatur user."; }; allowRunAsUsers = mkOption { type = with types; listOf str; From 9ac3d93b27af7a2abfa1a95d8c34cbe327748794 Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Thu, 14 Jul 2022 23:45:27 +0200 Subject: [PATCH 4/7] improve comments, descriptions --- modules/presets/secure-node.nix | 2 +- pkgs/lib.nix | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/presets/secure-node.nix b/modules/presets/secure-node.nix index 34d8ed5..506d058 100644 --- a/modules/presets/secure-node.nix +++ b/modules/presets/secure-node.nix @@ -30,7 +30,7 @@ in { jq ]; - # sshd + # Add a SSH onion service services.tor.relay.onionServices.sshd = nbLib.mkOnionService { port = 22; }; nix-bitcoin.onionAddresses.access.${operatorName} = [ "sshd" ]; diff --git a/pkgs/lib.nix b/pkgs/lib.nix index 07a105d..fb25950 100644 --- a/pkgs/lib.nix +++ b/pkgs/lib.nix @@ -41,7 +41,7 @@ let self = { RestrictAddressFamilies = self.defaultHardening.RestrictAddressFamilies + " AF_NETLINK"; }; - # nodejs applications apparently rely on memory write execute + # nodejs applications require memory write execute for JIT compilation nodejs = { MemoryDenyWriteExecute = "false"; }; # Allow takes precedence over Deny. @@ -69,7 +69,7 @@ let self = { type = types.bool; default = false; description = '' - Whether to enforce Tor on a service by only allowing connections + Whether to enforce Tor on this service by only allowing connections from and to localhost and link-local addresses. ''; }; From c82e0ee294ac4061aef5b6d8d07a9a7ebc8c7ee4 Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Thu, 14 Jul 2022 23:45:28 +0200 Subject: [PATCH 5/7] clightning/plugins: format plugin defs, order alphabetically --- pkgs/clightning-plugins/default.nix | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/pkgs/clightning-plugins/default.nix b/pkgs/clightning-plugins/default.nix index 68187ab..9a85a96 100644 --- a/pkgs/clightning-plugins/default.nix +++ b/pkgs/clightning-plugins/default.nix @@ -13,7 +13,16 @@ let version = builtins.substring 0 7 src.rev; plugins = with nbPython3Packages; { - helpme = { description = "Walks you through setting up a c-lightning node, offering advice for common problems"; }; + commando = { + description = "Enable RPC over lightning"; + extraPkgs = [ nbPython3Packages.runes ]; + }; + feeadjuster = { + description = "Dynamically changes channel fees to keep your channels more balanced"; + }; + helpme = { + description = "Walks you through setting up a c-lightning node, offering advice for common problems"; + }; monitor = { description = "Helps you analyze the health of your peers and channels"; extraPkgs = [ packaging ]; @@ -25,10 +34,8 @@ let "--replace prometheus-client==0.6.0 prometheus-client==0.13.1" + " --replace pyln-client~=0.9.3 pyln-client~=0.10.1"; }; - rebalance = { description = "Keeps your channels balanced"; }; - commando = { - description = "Enable RPC over lightning"; - extraPkgs = [ nbPython3Packages.runes ]; + rebalance = { + description = "Keeps your channels balanced"; }; summary = { description = "Prints a summary of the node status"; @@ -39,9 +46,6 @@ let scriptName = "cl-zmq"; extraPkgs = [ twisted txzmq ]; }; - feeadjuster = { - description = "Dynamically changes channel fees to keep your channels more balanced"; - }; }; basePkgs = [ nbPython3Packages.pyln-client ]; From 9d20837b903d6aa1af86931f66e7cfcef357e14a Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Fri, 15 Jul 2022 11:42:02 +0200 Subject: [PATCH 6/7] flake: remove `rec` --- flake.nix | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index 2cf84cf..6a4ad3d 100644 --- a/flake.nix +++ b/flake.nix @@ -13,8 +13,7 @@ outputs = { self, nixpkgs, nixpkgsUnstable, flake-utils }: let supportedSystems = [ "x86_64-linux" "i686-linux" "aarch64-linux" ]; - in - rec { + in { lib = { mkNbPkgs = { system @@ -25,7 +24,7 @@ }; overlays.default = final: prev: let - nbPkgs = lib.mkNbPkgs { inherit (final) system; pkgs = final; }; + nbPkgs = self.lib.mkNbPkgs { inherit (final) system; pkgs = final; }; in removeAttrs nbPkgs [ "pinned" "nixops19_09" "krops" ]; nixosModules.default = { config, pkgs, lib, ... }: { From 84b69dfb4676f95518316088c2a5a90ed020169d Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Sun, 17 Jul 2022 12:45:22 +0200 Subject: [PATCH 7/7] versioning: improve description wording --- examples/configuration.nix | 2 +- modules/versioning.nix | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/configuration.nix b/examples/configuration.nix index 0b5ccd7..1dec72d 100644 --- a/examples/configuration.nix +++ b/examples/configuration.nix @@ -280,6 +280,6 @@ # The nix-bitcoin release version that your config is compatible with. # When upgrading to a backwards-incompatible release, nix-bitcoin will display an - # an error and provide hints for migrating your config to the new release. + # an error and provide instructions for migrating your config to the new release. nix-bitcoin.configVersion = "0.0.70"; } diff --git a/modules/versioning.nix b/modules/versioning.nix index ad3bf7d..445def8 100644 --- a/modules/versioning.nix +++ b/modules/versioning.nix @@ -16,8 +16,8 @@ let compatible with. When upgrading to a backwards-incompatible release, nix-bitcoin will throw an - error during evaluation and provide hints for migrating your config to the - new release. + error during evaluation and provide instructions for migrating your config to + the new release. ''; }; };