mirror of
https://github.com/fort-nix/nix-bitcoin.git
synced 2024-11-30 03:32:05 +03:00
rtl: add option extraCurrency
This commit is contained in:
parent
62a2602e78
commit
10a744a598
@ -49,6 +49,17 @@ let
|
|||||||
default = false;
|
default = false;
|
||||||
description = "Enable the Night UI Theme.";
|
description = "Enable the Night UI Theme.";
|
||||||
};
|
};
|
||||||
|
extraCurrency = mkOption {
|
||||||
|
type = with types; nullOr str;
|
||||||
|
default = null;
|
||||||
|
example = "USD";
|
||||||
|
description = ''
|
||||||
|
Currency code (ISO 4217) of the extra currency used for displaying balances.
|
||||||
|
When set, this option enables online currency rate fetching.
|
||||||
|
Warning: Rate fetching requires outgoing clearnet connections, so option
|
||||||
|
`tor.enforce` is automatically disabled.
|
||||||
|
'';
|
||||||
|
};
|
||||||
user = mkOption {
|
user = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
default = "rtl";
|
default = "rtl";
|
||||||
@ -118,7 +129,10 @@ let
|
|||||||
''"channelBackupPath": "${cfg.dataDir}/backup/lnd",''
|
''"channelBackupPath": "${cfg.dataDir}/backup/lnd",''
|
||||||
}
|
}
|
||||||
"logLevel": "INFO",
|
"logLevel": "INFO",
|
||||||
"fiatConversion": false,
|
"fiatConversion": ${if cfg.extraCurrency == null then "false" else "true"},
|
||||||
|
${optionalString (cfg.extraCurrency != null)
|
||||||
|
''"currencyUnit": "${cfg.extraCurrency}",''
|
||||||
|
}
|
||||||
${optionalString (isLnd && cfg.loop)
|
${optionalString (isLnd && cfg.loop)
|
||||||
''"swapServerUrl": "https://${nbLib.addressWithPort lightning-loop.restAddress lightning-loop.restPort}",''
|
''"swapServerUrl": "https://${nbLib.addressWithPort lightning-loop.restAddress lightning-loop.restPort}",''
|
||||||
}
|
}
|
||||||
@ -190,6 +204,8 @@ in {
|
|||||||
"d '${cfg.dataDir}' 0770 ${cfg.user} ${cfg.group} - -"
|
"d '${cfg.dataDir}' 0770 ${cfg.user} ${cfg.group} - -"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
services.rtl.tor.enforce = mkIf (cfg.extraCurrency != null) false;
|
||||||
|
|
||||||
systemd.services.rtl = rec {
|
systemd.services.rtl = rec {
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
requires = optional cfg.nodes.clightning "cl-rest.service" ++
|
requires = optional cfg.nodes.clightning "cl-rest.service" ++
|
||||||
|
@ -67,6 +67,7 @@ let
|
|||||||
nix-bitcoin.generateSecretsCmds.rtl = mkIf cfg.rtl.enable (mkForce ''
|
nix-bitcoin.generateSecretsCmds.rtl = mkIf cfg.rtl.enable (mkForce ''
|
||||||
echo a > rtl-password
|
echo a > rtl-password
|
||||||
'');
|
'');
|
||||||
|
services.rtl.extraCurrency = mkDefault "CHF";
|
||||||
|
|
||||||
tests.spark-wallet = cfg.spark-wallet.enable;
|
tests.spark-wallet = cfg.spark-wallet.enable;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user