add module assertions

This commit is contained in:
nixbitcoin 2020-06-15 10:34:11 +00:00
parent 23cd323ad1
commit f280d54bb8
No known key found for this signature in database
GPG Key ID: DD11F9AD5308B3BA
8 changed files with 51 additions and 0 deletions

View File

@ -61,6 +61,12 @@ in {
}; };
config = mkIf cfg.enable (mkMerge [{ config = mkIf cfg.enable (mkMerge [{
assertions = [
{ assertion = config.services.bitcoind.prune == 0;
message = "electrs does not support bitcoind pruning.";
}
];
environment.systemPackages = [ pkgs.nix-bitcoin.electrs ]; environment.systemPackages = [ pkgs.nix-bitcoin.electrs ];
systemd.tmpfiles.rules = [ systemd.tmpfiles.rules = [

View File

@ -33,6 +33,15 @@ in {
config = mkMerge [ config = mkMerge [
(mkIf (cfg.ledger || cfg.trezor) { (mkIf (cfg.ledger || cfg.trezor) {
assertions = [
{ assertion = (config.services.bitcoind.disablewallet == null || !config.services.bitcoind.disablewallet);
message = ''
Hardware-Wallets are not compatible with bitcoind.disablewallet.
Note that this option is active when enabling electrs.high-memory.
'';
}
];
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
nix-bitcoin.hwi nix-bitcoin.hwi
# Provides lsusb for debugging # Provides lsusb for debugging

View File

@ -24,6 +24,12 @@ in {
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
assertions = [
{ assertion = config.services.clightning.enable;
message = "lightning-charge requires clightning.";
}
];
users.users.lightning-charge = { users.users.lightning-charge = {
description = "lightning-charge User"; description = "lightning-charge User";
group = "lightning-charge"; group = "lightning-charge";

View File

@ -83,6 +83,12 @@ in {
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
assertions = [
{ assertion = config.services.bitcoind.prune == 0;
message = "lnd does not support bitcoind pruning.";
}
];
environment.systemPackages = [ cfg.package (hiPrio cfg.cli) ]; environment.systemPackages = [ cfg.package (hiPrio cfg.cli) ];
systemd.tmpfiles.rules = [ systemd.tmpfiles.rules = [

View File

@ -52,6 +52,12 @@ in {
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
assertions = [
{ assertion = config.services.lightning-charge.enable;
message = "nanopos requires lightning-charge.";
}
];
environment.systemPackages = [ pkgs.nix-bitcoin.nanopos ]; environment.systemPackages = [ pkgs.nix-bitcoin.nanopos ];
systemd.services.nanopos = { systemd.services.nanopos = {
description = "Run nanopos"; description = "Run nanopos";

View File

@ -47,6 +47,12 @@ in {
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
assertions = [
{ assertion = config.services.nanopos.enable;
message = "nix-bitcoin-webindex requires nanopos.";
}
];
systemd.tmpfiles.rules = [ systemd.tmpfiles.rules = [
"d /var/www 0755 nginx nginx - -" "d /var/www 0755 nginx nginx - -"
]; ];

View File

@ -78,6 +78,12 @@ in {
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
assertions = [
{ assertion = config.services.clightning.enable;
message = "recurring-donations requires clightning.";
}
];
users.users.recurring-donations = { users.users.recurring-donations = {
description = "recurring-donations User"; description = "recurring-donations User";
group = "recurring-donations"; group = "recurring-donations";

View File

@ -46,6 +46,12 @@ in {
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
assertions = [
{ assertion = config.services.clightning.enable;
message = "spark-wallet requires clightning.";
}
];
environment.systemPackages = [ pkgs.nix-bitcoin.spark-wallet ]; environment.systemPackages = [ pkgs.nix-bitcoin.spark-wallet ];
users.users.spark-wallet = { users.users.spark-wallet = {
description = "spark-wallet User"; description = "spark-wallet User";