From 63e2c6d2700498edcda58f5d03003ce27d42f076 Mon Sep 17 00:00:00 2001 From: Jonas Nick Date: Tue, 20 Nov 2018 22:21:45 +0000 Subject: [PATCH] cleanups --- configuration.nix | 8 ++++---- modules/{default.nix => bitcoind.nix} | 0 modules/{onionnode.nix => nixbitcoin.nix} | 15 ++++++++++++--- modules/nodeinfo.nix | 17 ----------------- 4 files changed, 16 insertions(+), 24 deletions(-) rename modules/{default.nix => bitcoind.nix} (100%) rename modules/{onionnode.nix => nixbitcoin.nix} (59%) delete mode 100644 modules/nodeinfo.nix diff --git a/configuration.nix b/configuration.nix index 230f2e8..0fd3b5c 100644 --- a/configuration.nix +++ b/configuration.nix @@ -4,16 +4,16 @@ { config, pkgs, ... }: let + # custom package nodeinfo = (import pkgs/nodeinfo.nix); in { disabledModules = [ "services/security/tor.nix" ]; imports = [ - ./modules/default.nix + ./modules/bitcoind.nix ./modules/tor.nix - ./modules/onionnode.nix - ./modules/nodeinfo.nix + ./modules/nixbitcoin.nix ]; networking.hostName = "nix-bitcoin"; # Define your hostname. @@ -42,7 +42,7 @@ in { services.tor.enable = true; services.tor.client.enable = true; #services.bitcoin.proxy = services.tor.client.socksListenAddress; - services.onionnode.enable = true; + services.nixbitcoin.enable = true; # turn off binary cache by passing the empty list diff --git a/modules/default.nix b/modules/bitcoind.nix similarity index 100% rename from modules/default.nix rename to modules/bitcoind.nix diff --git a/modules/onionnode.nix b/modules/nixbitcoin.nix similarity index 59% rename from modules/onionnode.nix rename to modules/nixbitcoin.nix index 1222d74..e2cb13c 100644 --- a/modules/onionnode.nix +++ b/modules/nixbitcoin.nix @@ -3,14 +3,14 @@ with lib; let - cfg = config.services.onionnode; + cfg = config.services.nixbitcoin; in { - options.services.onionnode = { + options.services.nixbitcoin = { enable = mkOption { type = types.bool; default = false; description = '' - If enabled, the onion service will be installed. + If enabled, the nix-bitcoin service will be installed. ''; }; }; @@ -28,5 +28,14 @@ in { }]; version = 3; }; + systemd.services.nodeinfo = { + description = "Get node info"; + wantedBy = [ "multi-user.target" ]; + serviceConfig = { + ExecStart = "${pkgs.bash}/bin/bash -c ${pkgs.nodeinfo}/bin/nodeinfo"; + user = "root"; + type = "oneshot"; + }; + }; }; } diff --git a/modules/nodeinfo.nix b/modules/nodeinfo.nix deleted file mode 100644 index 6db0a39..0000000 --- a/modules/nodeinfo.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ config, lib, pkgs, ... }: - -with lib; - -{ - config = { - systemd.services.nodeinfo = { - description = "Get node info"; - wantedBy = [ "multi-user.target" ]; - serviceConfig = { - ExecStart = "${pkgs.bash}/bin/bash -c ${pkgs.nodeinfo}/bin/nodeinfo"; - user = "root"; - type = "oneshot"; - }; - }; - }; -}