nanopos: remove package and module
This commit is contained in:
parent
da674d1ccf
commit
58de79d401
@ -69,7 +69,6 @@ NixOS modules
|
||||
* [btcpayserver](https://github.com/btcpayserver/btcpayserver)
|
||||
* [liquid](https://github.com/elementsproject/elements)
|
||||
* [lightning charge](https://github.com/ElementsProject/lightning-charge) (deprecated)
|
||||
* [nanopos](https://github.com/ElementsProject/nanopos) (deprecated)
|
||||
* [Lightning Loop](https://github.com/lightninglabs/loop)
|
||||
* [JoinMarket](https://github.com/joinmarket-org/joinmarket-clientserver)
|
||||
* [recurring-donations](modules/recurring-donations.nix): for periodic lightning payments
|
||||
|
@ -107,16 +107,9 @@
|
||||
# Automatically enables clightning.
|
||||
# services.lightning-charge.enable = true;
|
||||
|
||||
### NANOPOS
|
||||
# Enable this module to use nanopos, a simple Lightning point-of-sale
|
||||
# system, powered by Lightning Charge.
|
||||
# Automatically enables lightning-charge.
|
||||
# services.nanopos.enable = true;
|
||||
|
||||
### WEBINDEX
|
||||
# Enable this module to use the nix-bitcoin-webindex, a simple website
|
||||
# displaying your node information and link to nanopos store. Only available
|
||||
# if clightning, lightning-charge, and nanopos are enabled.
|
||||
# displaying your node information. Only available if clightning is enabled.
|
||||
# services.nix-bitcoin-webindex.enable = true;
|
||||
|
||||
### RECURRING-DONATIONS
|
||||
|
@ -6,7 +6,6 @@
|
||||
electrs = ./electrs.nix;
|
||||
lightning-charge = ./lightning-charge.nix;
|
||||
liquid = ./liquid.nix;
|
||||
nanopos = ./nanopos.nix;
|
||||
presets.secure-node = ./presets/secure-node.nix;
|
||||
nix-bitcoin-webindex = ./nix-bitcoin-webindex.nix;
|
||||
spark-wallet = ./spark-wallet.nix;
|
||||
|
@ -12,7 +12,6 @@ with lib;
|
||||
./clightning.nix
|
||||
./clightning-plugins
|
||||
./lightning-charge.nix
|
||||
./nanopos.nix
|
||||
./spark-wallet.nix
|
||||
./lnd.nix
|
||||
./lightning-loop.nix
|
||||
|
@ -1,118 +0,0 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
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
|
||||
title: Green Tea # title is optional, defaults to the key
|
||||
|
||||
coffee:
|
||||
price: 1
|
||||
|
||||
bamba:
|
||||
price: 3
|
||||
|
||||
beer:
|
||||
price: 7
|
||||
|
||||
hat:
|
||||
price: 15
|
||||
|
||||
tshirt:
|
||||
price: 25
|
||||
'';
|
||||
|
||||
in {
|
||||
options.services.nanopos = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
If enabled, the nanopos service will be installed.
|
||||
'';
|
||||
};
|
||||
port = mkOption {
|
||||
type = types.port;
|
||||
default = 9116;
|
||||
description = ''
|
||||
"The port on which to listen for connections.";
|
||||
'';
|
||||
};
|
||||
itemsFile = mkOption {
|
||||
type = types.path;
|
||||
default = defaultItemsFile;
|
||||
description = ''
|
||||
"The items file (see nanopos README).";
|
||||
'';
|
||||
};
|
||||
charged-url = mkOption {
|
||||
type = types.str;
|
||||
default = "http://localhost:9112";
|
||||
description = ''
|
||||
"The lightning charge server url.";
|
||||
'';
|
||||
};
|
||||
host = mkOption {
|
||||
type = types.str;
|
||||
default = "127.0.0.1";
|
||||
description = ''
|
||||
"http server listen address.";
|
||||
'';
|
||||
};
|
||||
extraArgs = mkOption {
|
||||
type = types.separatedString " ";
|
||||
default = "";
|
||||
description = "Extra command line arguments passed to nanopos.";
|
||||
};
|
||||
enforceTor = nix-bitcoin-services.enforceTor;
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
warnings = [''
|
||||
The nanopos module is deprecated and will be removed soon. You can use the
|
||||
btcpayserver module instead.
|
||||
''];
|
||||
|
||||
services.lightning-charge.enable = true;
|
||||
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
virtualHosts."_" = {
|
||||
root = "/var/www";
|
||||
extraConfig = ''
|
||||
location /store/ {
|
||||
proxy_pass http://${toString cfg.host}:${toString cfg.port};
|
||||
rewrite /store/(.*) /$1 break;
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services.nanopos = {
|
||||
description = "Run nanopos";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
requires = [ "lightning-charge.service" ];
|
||||
after = [ "lightning-charge.service" ];
|
||||
serviceConfig = nix-bitcoin-services.defaultHardening // {
|
||||
EnvironmentFile = "${config.nix-bitcoin.secretsDir}/nanopos-env";
|
||||
ExecStart = "${config.nix-bitcoin.pkgs.nanopos}/bin/nanopos -y ${cfg.itemsFile} -i ${toString cfg.host} -p ${toString cfg.port} -c ${toString cfg.charged-url} --show-bolt11 ${cfg.extraArgs}";
|
||||
User = "nanopos";
|
||||
Restart = "on-failure";
|
||||
RestartSec = "10s";
|
||||
} // (if cfg.enforceTor
|
||||
then nix-bitcoin-services.allowTor
|
||||
else nix-bitcoin-services.allowAnyIP)
|
||||
// nix-bitcoin-services.nodejs;
|
||||
};
|
||||
users.users.nanopos = {
|
||||
description = "nanopos User";
|
||||
group = "nanopos";
|
||||
};
|
||||
users.groups.nanopos = {};
|
||||
nix-bitcoin.secrets.nanopos-env.user = "nanopos";
|
||||
};
|
||||
}
|
@ -221,10 +221,6 @@ in {
|
||||
id = 18;
|
||||
# communicates with clightning over lightning-rpc socket
|
||||
};
|
||||
nanopos = {
|
||||
id = 19;
|
||||
connections = [ "nginx" "lightning-charge" ];
|
||||
};
|
||||
recurring-donations = {
|
||||
id = 20;
|
||||
# communicates with clightning over lightning-rpc socket
|
||||
@ -288,11 +284,6 @@ in {
|
||||
|
||||
services.lightning-charge.host = netns.lightning-charge.address;
|
||||
|
||||
services.nanopos = {
|
||||
charged-url = "http://${netns.lightning-charge.address}:9112";
|
||||
host = netns.nanopos.address;
|
||||
};
|
||||
|
||||
services.lightning-loop.rpcAddress = netns.lightning-loop.address;
|
||||
|
||||
services.nbxplorer.bind = netns.nbxplorer.address;
|
||||
|
@ -13,7 +13,6 @@ let
|
||||
nix-bitcoin
|
||||
</h1>
|
||||
</p>
|
||||
${optionalString config.services.nanopos.enable ''<p><h2><a href="store/">store</a></h2></p>''}
|
||||
<p>
|
||||
<h3>
|
||||
lightning node: CLIGHTNING_ID
|
||||
@ -52,8 +51,8 @@ in {
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
assertions = [
|
||||
{ assertion = config.services.nanopos.enable;
|
||||
message = "nix-bitcoin-webindex requires nanopos.";
|
||||
{ assertion = config.services.clightning.enable;
|
||||
message = "nix-bitcoin-webindex requires clightning.";
|
||||
}
|
||||
];
|
||||
|
||||
|
@ -113,8 +113,6 @@ in {
|
||||
|
||||
services.lightning-charge.enforceTor = true;
|
||||
|
||||
services.nanopos.enforceTor = true;
|
||||
|
||||
services.recurring-donations.enforceTor = true;
|
||||
|
||||
services.nix-bitcoin-webindex.enforceTor = true;
|
||||
|
@ -1,7 +1,6 @@
|
||||
{ pkgs ? import <nixpkgs> {} }:
|
||||
let self = {
|
||||
lightning-charge = pkgs.callPackage ./lightning-charge { };
|
||||
nanopos = pkgs.callPackage ./nanopos { };
|
||||
spark-wallet = pkgs.callPackage ./spark-wallet { };
|
||||
electrs = pkgs.callPackage ./electrs { };
|
||||
elementsd = pkgs.callPackage ./elementsd { withGui = false; };
|
||||
|
@ -27,7 +27,6 @@ makePasswordSecret jm-wallet-password
|
||||
[[ -e bitcoin-HMAC-public ]] || makeHMAC public
|
||||
[[ -e bitcoin-HMAC-btcpayserver ]] || makeHMAC btcpayserver
|
||||
[[ -e lightning-charge-env ]] || echo "API_TOKEN=$(cat lightning-charge-token)" > lightning-charge-env
|
||||
[[ -e nanopos-env ]] || echo "CHARGE_TOKEN=$(cat lightning-charge-token)" > nanopos-env
|
||||
[[ -e spark-wallet-login ]] || echo "login=spark-wallet:$(cat spark-wallet-password)" > spark-wallet-login
|
||||
[[ -e backup-encryption-env ]] || echo "PASSPHRASE=$(cat backup-encryption-password)" > backup-encryption-env
|
||||
|
||||
|
@ -1,21 +0,0 @@
|
||||
# This file has been generated by node2nix 1.6.1. Do not edit!
|
||||
|
||||
{pkgs ? import <nixpkgs> {
|
||||
inherit system;
|
||||
}, system ? builtins.currentSystem, nodejs ? pkgs."nodejs-10_x"}:
|
||||
|
||||
let
|
||||
globalBuildInputs = pkgs.lib.attrValues (import ./supplement.nix {
|
||||
inherit nodeEnv;
|
||||
inherit (pkgs) fetchurl fetchgit;
|
||||
});
|
||||
nodeEnv = import ./node-env.nix {
|
||||
inherit (pkgs) stdenv python2 utillinux runCommand writeTextFile;
|
||||
inherit nodejs;
|
||||
libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null;
|
||||
};
|
||||
in
|
||||
import ./node-packages.nix {
|
||||
inherit (pkgs) fetchurl fetchgit;
|
||||
inherit nodeEnv globalBuildInputs;
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
{ stdenv, pkgs, lib }:
|
||||
lib.head (lib.attrValues (import ./composition.nix {
|
||||
inherit pkgs;
|
||||
inherit (stdenv.hostPlatform) system;
|
||||
}))
|
@ -1,3 +0,0 @@
|
||||
#!/usr/bin/env nix-shell
|
||||
#! nix-shell -i bash -p nodePackages.node2nix
|
||||
exec node2nix --nodejs-10 -i pkg.json -c composition.nix --no-copy-node-env --supplement-input supplement.json
|
@ -1 +0,0 @@
|
||||
import <nixpkgs/pkgs/development/node-packages/node-env.nix>
|
File diff suppressed because it is too large
Load Diff
@ -1,3 +0,0 @@
|
||||
[
|
||||
{ "nanopos": "^0.1.5" }
|
||||
]
|
@ -1,2 +0,0 @@
|
||||
[
|
||||
]
|
@ -1,8 +0,0 @@
|
||||
# This file has been generated by node2nix 1.6.1. Do not edit!
|
||||
|
||||
{nodeEnv, fetchurl, fetchgit, globalBuildInputs ? []}:
|
||||
|
||||
let
|
||||
sources = {};
|
||||
in
|
||||
{}
|
@ -43,8 +43,6 @@ let testEnv = rec {
|
||||
|
||||
tests.spark-wallet = cfg.spark-wallet.enable;
|
||||
|
||||
tests.nanopos = cfg.nanopos.enable;
|
||||
|
||||
tests.lnd = cfg.lnd.enable;
|
||||
services.lnd.listenPort = 9736;
|
||||
|
||||
@ -114,7 +112,6 @@ let testEnv = rec {
|
||||
test.features.clightningPlugins = true;
|
||||
services.spark-wallet.enable = true;
|
||||
services.lightning-charge.enable = true;
|
||||
services.nanopos.enable = true;
|
||||
services.lnd.enable = true;
|
||||
services.lightning-loop.enable = true;
|
||||
services.electrs.enable = true;
|
||||
|
@ -212,13 +212,6 @@ def _():
|
||||
)
|
||||
|
||||
|
||||
@test("nanopos")
|
||||
def _():
|
||||
assert_running("nanopos")
|
||||
wait_for_open_port(ip("nanopos"), 9116)
|
||||
assert_matches(f"curl {ip('nanopos')}:9116", "tshirt")
|
||||
|
||||
|
||||
@test("joinmarket")
|
||||
def _():
|
||||
assert_running("joinmarket")
|
||||
@ -245,7 +238,6 @@ def _():
|
||||
assert_running("nginx")
|
||||
wait_for_open_port(ip("nginx"), 80)
|
||||
assert_matches(f"curl {ip('nginx')}", "nix-bitcoin")
|
||||
assert_matches(f"curl -L {ip('nginx')}/store", "tshirt")
|
||||
|
||||
|
||||
# Run this test before the following tests that shut down services
|
||||
@ -326,7 +318,7 @@ def _():
|
||||
|
||||
# Sanity-check system by restarting all services
|
||||
succeed(
|
||||
"systemctl restart bitcoind clightning lnd lightning-loop spark-wallet lightning-charge nanopos liquidd"
|
||||
"systemctl restart bitcoind clightning lnd lightning-loop spark-wallet lightning-charge liquidd"
|
||||
)
|
||||
|
||||
# Now that the bitcoind restart triggered a banlist import restart, check that
|
||||
|
Loading…
Reference in New Issue
Block a user