add 'nix-bitcoin-services' option
1. Makes the content easily accessible for module users 2. Avoids needlessly recalculating the attrset in every client module
This commit is contained in:
parent
7aaf30501c
commit
f0a36fe0c7
@ -3,8 +3,8 @@
|
||||
with lib;
|
||||
|
||||
let
|
||||
nix-bitcoin-services = pkgs.callPackage ./nix-bitcoin-services.nix { };
|
||||
cfg = config.services.bitcoind;
|
||||
inherit (config) nix-bitcoin-services;
|
||||
pidFile = "${cfg.dataDir}/bitcoind.pid";
|
||||
configFile = pkgs.writeText "bitcoin.conf" ''
|
||||
${optionalString cfg.testnet "testnet=1"}
|
||||
|
@ -3,8 +3,8 @@
|
||||
with lib;
|
||||
|
||||
let
|
||||
nix-bitcoin-services = pkgs.callPackage ./nix-bitcoin-services.nix { };
|
||||
cfg = config.services.clightning;
|
||||
inherit (config) nix-bitcoin-services;
|
||||
configFile = pkgs.writeText "config" ''
|
||||
autolisten=${if cfg.autolisten then "true" else "false"}
|
||||
network=bitcoin
|
||||
|
@ -3,8 +3,8 @@
|
||||
with lib;
|
||||
|
||||
let
|
||||
nix-bitcoin-services = pkgs.callPackage ./nix-bitcoin-services.nix { };
|
||||
cfg = config.services.electrs;
|
||||
inherit (config) nix-bitcoin-services;
|
||||
index-batch-size = "${if cfg.high-memory then "" else "--index-batch-size=10"}";
|
||||
jsonrpc-import = "${if cfg.high-memory then "" else "--jsonrpc-import"}";
|
||||
in {
|
||||
|
@ -3,8 +3,8 @@
|
||||
with lib;
|
||||
|
||||
let
|
||||
nix-bitcoin-services = pkgs.callPackage ./nix-bitcoin-services.nix { };
|
||||
cfg = config.services.lightning-charge;
|
||||
inherit (config) nix-bitcoin-services;
|
||||
in {
|
||||
options.services.lightning-charge = {
|
||||
enable = mkOption {
|
||||
|
@ -3,8 +3,8 @@
|
||||
with lib;
|
||||
|
||||
let
|
||||
nix-bitcoin-services = pkgs.callPackage ./nix-bitcoin-services.nix { };
|
||||
cfg = config.services.liquidd;
|
||||
inherit (config) nix-bitcoin-services;
|
||||
pidFile = "${cfg.dataDir}/liquidd.pid";
|
||||
configFile = pkgs.writeText "elements.conf" ''
|
||||
chain=liquidv1
|
||||
|
@ -3,8 +3,8 @@
|
||||
with lib;
|
||||
|
||||
let
|
||||
nix-bitcoin-services = pkgs.callPackage ./nix-bitcoin-services.nix { };
|
||||
cfg = config.services.lnd;
|
||||
inherit (config) nix-bitcoin-services;
|
||||
configFile = pkgs.writeText "lnd.conf" ''
|
||||
datadir=${cfg.dataDir}
|
||||
logdir=${cfg.dataDir}/logs
|
||||
|
@ -1,4 +1,4 @@
|
||||
{ config, pkgs, ... }:
|
||||
{ config, pkgs, lib, ... }:
|
||||
let
|
||||
nixpkgs-pinned = import ../pkgs/nixpkgs-pinned.nix;
|
||||
unstable = import nixpkgs-pinned.nixpkgs-unstable {};
|
||||
@ -27,7 +27,16 @@ in {
|
||||
|
||||
disabledModules = [ "services/networking/bitcoind.nix" ];
|
||||
|
||||
options = {
|
||||
nix-bitcoin-services = lib.mkOption {
|
||||
readOnly = true;
|
||||
default = import ./nix-bitcoin-services.nix lib;
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
nixpkgs.overlays = [ (self: super: {
|
||||
nix-bitcoin = allPackages super;
|
||||
}) ];
|
||||
};
|
||||
}
|
||||
|
@ -3,8 +3,8 @@
|
||||
with lib;
|
||||
|
||||
let
|
||||
nix-bitcoin-services = pkgs.callPackage ./nix-bitcoin-services.nix { };
|
||||
cfg = config.services.nanopos;
|
||||
inherit (config) nix-bitcoin-services;
|
||||
defaultItemsFile = pkgs.writeText "items.yaml" ''
|
||||
tea:
|
||||
price: 0.02 # denominated in the currency specified by --currency
|
||||
|
@ -1,7 +1,7 @@
|
||||
# See `man systemd.exec` and `man systemd.resource-control` for an explanation
|
||||
# of the various systemd options available through this module.
|
||||
|
||||
{ config, lib, pkgs, ... }:
|
||||
lib:
|
||||
|
||||
with lib;
|
||||
{
|
||||
|
@ -3,8 +3,8 @@
|
||||
with lib;
|
||||
|
||||
let
|
||||
nix-bitcoin-services = pkgs.callPackage ./nix-bitcoin-services.nix { };
|
||||
cfg = config.services.nix-bitcoin-webindex;
|
||||
inherit (config) nix-bitcoin-services;
|
||||
indexFile = pkgs.writeText "index.html" ''
|
||||
<html>
|
||||
<body>
|
||||
|
@ -8,8 +8,8 @@
|
||||
with lib;
|
||||
|
||||
let
|
||||
nix-bitcoin-services = pkgs.callPackage ./nix-bitcoin-services.nix { };
|
||||
cfg = config.services.onion-chef;
|
||||
inherit (config) nix-bitcoin-services;
|
||||
dataDir = "/var/lib/onion-chef/";
|
||||
onion-chef-script = pkgs.writeScript "onion-chef.sh" ''
|
||||
# wait until tor is up
|
||||
|
@ -3,8 +3,8 @@
|
||||
with lib;
|
||||
|
||||
let
|
||||
nix-bitcoin-services = pkgs.callPackage ./nix-bitcoin-services.nix { };
|
||||
cfg = config.services.recurring-donations;
|
||||
inherit (config) nix-bitcoin-services;
|
||||
recurring-donations-script = pkgs.writeScript "recurring-donations.sh" ''
|
||||
LNCLI="lightning-cli --lightning-dir=${config.services.clightning.dataDir}"
|
||||
pay_tallycoin() {
|
||||
|
@ -3,8 +3,8 @@
|
||||
with lib;
|
||||
|
||||
let
|
||||
nix-bitcoin-services = pkgs.callPackage ./nix-bitcoin-services.nix { };
|
||||
cfg = config.services.spark-wallet;
|
||||
inherit (config) nix-bitcoin-services;
|
||||
dataDir = "/var/lib/spark-wallet/";
|
||||
onion-chef-service = (if cfg.onion-service then [ "onion-chef.service" ] else []);
|
||||
run-spark-wallet = pkgs.writeScript "run-spark-wallet" ''
|
||||
|
Loading…
Reference in New Issue
Block a user