From 1a63f0ca6acaebdfc6448424e155aaf5d96d61fe Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Tue, 7 Apr 2020 22:47:34 +0200 Subject: [PATCH] remove option 'services.nix-bitcoin.enable' Users can enable the node config just by importing secure-node.nix --- examples/configuration.nix | 5 +---- modules/nix-bitcoin.nix | 8 +++++++- modules/presets/secure-node.nix | 1 - test/test.nix | 1 - 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/examples/configuration.nix b/examples/configuration.nix index a72ebdc..ee24f4f 100644 --- a/examples/configuration.nix +++ b/examples/configuration.nix @@ -18,10 +18,7 @@ #./hardware-configuration.nix ]; # 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; + # modules by commenting out their respective line. ### BITCOIND # Bitcoind is enabled by default if nix-bitcoin is enabled diff --git a/modules/nix-bitcoin.nix b/modules/nix-bitcoin.nix index 3063ad9..64879d0 100644 --- a/modules/nix-bitcoin.nix +++ b/modules/nix-bitcoin.nix @@ -1,3 +1,9 @@ # This file exists only for backwards compatibility -import ./presets/secure-node.nix +{ lib, ... }: +{ + imports = [ + ./presets/secure-node.nix + (lib.mkRemovedOptionModule [ "services" "nix-bitcoin" "enable" ] "Please directly import ./presets/secure-node.nix") + ] +} diff --git a/modules/presets/secure-node.nix b/modules/presets/secure-node.nix index 818bf7f..d454ddf 100644 --- a/modules/presets/secure-node.nix +++ b/modules/presets/secure-node.nix @@ -3,7 +3,6 @@ with lib; let - cfg = config.services.nix-bitcoin; operatorCopySSH = pkgs.writeText "operator-copy-ssh.sh" '' mkdir -p ${config.users.users.operator.home}/.ssh if [ -e "${config.users.users.root.home}/.vbox-nixops-client-key" ]; then diff --git a/test/test.nix b/test/test.nix index d8557c5..d609d3d 100644 --- a/test/test.nix +++ b/test/test.nix @@ -16,7 +16,6 @@ import ./make-test.nix rec { # hardened ]; - services.nix-bitcoin.enable = true; services.bitcoind.extraConfig = mkForce "connect=0"; services.clightning.enable = true;