mirror of
https://github.com/fort-nix/nix-bitcoin.git
synced 2024-11-26 08:10:41 +03:00
move systemPackages definitions to services
These are generally useful and shouldn't be limited to secure-node.nix. Also, only add the hardware-wallets group when hardware wallets are enabled.
This commit is contained in:
parent
6c22e13b7f
commit
37b2faf63c
@ -256,7 +256,7 @@ in {
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = [ cfg.package ];
|
||||
environment.systemPackages = [ cfg.package (hiPrio cfg.cli) ];
|
||||
systemd.services.bitcoind = {
|
||||
description = "Bitcoin daemon";
|
||||
requires = [ "nix-bitcoin-secrets.target" ];
|
||||
|
@ -71,6 +71,7 @@ in {
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = [ pkgs.nix-bitcoin.clightning (hiPrio cfg.cli) ];
|
||||
users.users.clightning = {
|
||||
description = "clightning User";
|
||||
group = "clightning";
|
||||
|
@ -61,6 +61,8 @@ in {
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [{
|
||||
environment.systemPackages = [ pkgs.nix-bitcoin.electrs ];
|
||||
|
||||
systemd.services.electrs = {
|
||||
description = "Electrs Electrum Server";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
@ -32,11 +32,16 @@ in {
|
||||
};
|
||||
|
||||
config = mkMerge [
|
||||
{
|
||||
# Create group
|
||||
(mkIf (cfg.ledger || cfg.trezor) {
|
||||
environment.systemPackages = with pkgs; [
|
||||
nix-bitcoin.hwi
|
||||
# Provides lsusb for debugging
|
||||
usbutils
|
||||
];
|
||||
users.groups."${cfg.group}" = {};
|
||||
}
|
||||
})
|
||||
(mkIf cfg.ledger {
|
||||
|
||||
# Ledger Nano S according to https://github.com/LedgerHQ/udev-rules/blob/master/add_udev_rules.sh
|
||||
# Don't use rules from nixpkgs because we want to use our own group.
|
||||
services.udev.packages = lib.singleton (pkgs.writeTextFile {
|
||||
@ -48,6 +53,7 @@ in {
|
||||
});
|
||||
})
|
||||
(mkIf cfg.trezor {
|
||||
environment.systemPackages = [ pkgs.python3.pkgs.trezor ];
|
||||
# Don't use rules from nixpkgs because we want to use our own group.
|
||||
services.udev.packages = lib.singleton (pkgs.writeTextFile {
|
||||
name = "trezord-udev-rules";
|
||||
|
@ -24,6 +24,7 @@ in {
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = [ pkgs.nix-bitcoin.lightning-charge ];
|
||||
systemd.services.lightning-charge = {
|
||||
description = "Run lightning-charge";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
@ -195,7 +195,11 @@ in {
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = [ pkgs.nix-bitcoin.elementsd ];
|
||||
environment.systemPackages = [
|
||||
pkgs.nix-bitcoin.elementsd
|
||||
(hiPrio cfg.cli)
|
||||
(hiPrio cfg.swap-cli)
|
||||
];
|
||||
systemd.services.liquidd = {
|
||||
description = "Elements daemon providing access to the Liquid sidechain";
|
||||
requires = [ "bitcoind.service" ];
|
||||
|
@ -77,7 +77,7 @@ in {
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = [ cfg.package ];
|
||||
environment.systemPackages = [ cfg.package (hiPrio cfg.cli) ];
|
||||
systemd.services.lnd = {
|
||||
description = "Run LND";
|
||||
path = [ pkgs.nix-bitcoin.bitcoind ];
|
||||
|
@ -52,6 +52,7 @@ in {
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = [ pkgs.nix-bitcoin.nanopos ];
|
||||
systemd.services.nanopos = {
|
||||
description = "Run nanopos";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
@ -60,7 +61,6 @@ in {
|
||||
serviceConfig = {
|
||||
EnvironmentFile = "${config.nix-bitcoin.secretsDir}/nanopos-env";
|
||||
ExecStart = "${pkgs.nix-bitcoin.nanopos}/bin/nanopos -y ${cfg.itemsFile} -p ${toString cfg.port} --show-bolt11";
|
||||
|
||||
User = "nanopos";
|
||||
Restart = "on-failure";
|
||||
RestartSec = "10s";
|
||||
|
@ -108,30 +108,11 @@ in {
|
||||
services.nix-bitcoin-webindex.enforceTor = true;
|
||||
|
||||
|
||||
environment.systemPackages = with pkgs; with nix-bitcoin;
|
||||
[
|
||||
environment.systemPackages = with pkgs; [
|
||||
tor
|
||||
bitcoind
|
||||
(hiPrio cfg.bitcoind.cli)
|
||||
nodeinfo
|
||||
jq
|
||||
qrencode
|
||||
]
|
||||
++ optionals cfg.clightning.enable [clightning (hiPrio cfg.clightning.cli)]
|
||||
++ optionals cfg.lnd.enable [lnd (hiPrio cfg.lnd.cli)]
|
||||
++ optionals cfg.lightning-charge.enable [lightning-charge]
|
||||
++ optionals cfg.nanopos.enable [nanopos]
|
||||
++ optionals cfg.nix-bitcoin-webindex.enable [nginx]
|
||||
++ optionals cfg.liquidd.enable [elementsd (hiPrio cfg.liquidd.cli) (hiPrio cfg.liquidd.swap-cli)]
|
||||
++ optionals cfg.spark-wallet.enable [spark-wallet]
|
||||
++ optionals cfg.electrs.enable [electrs]
|
||||
++ optionals (cfg.hardware-wallets.ledger || cfg.hardware-wallets.trezor) [
|
||||
hwi
|
||||
# To allow debugging issues with lsusb
|
||||
usbutils
|
||||
]
|
||||
++ optionals cfg.hardware-wallets.trezor [
|
||||
python3.pkgs.trezor
|
||||
nix-bitcoin.nodeinfo
|
||||
];
|
||||
|
||||
# Create user operator which can use bitcoin-cli and lightning-cli
|
||||
|
@ -47,6 +47,7 @@ in {
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = [ pkgs.nix-bitcoin.spark-wallet ];
|
||||
services.tor.enable = cfg.onion-service;
|
||||
# requires client functionality for Bitcoin rate lookup
|
||||
services.tor.client.enable = true;
|
||||
|
Loading…
Reference in New Issue
Block a user