2020-01-12 19:52:40 +00:00
|
|
|
# Integration test, can be run without internet access.
|
|
|
|
|
2020-07-16 14:48:41 +00:00
|
|
|
{ scenario ? "default" }:
|
|
|
|
|
|
|
|
let
|
|
|
|
netns-isolation = builtins.getAttr scenario { default = false; withnetns = true; };
|
|
|
|
testScriptFilename = builtins.getAttr scenario { default = ./scenarios/default.py; withnetns = ./scenarios/withnetns.py; };
|
|
|
|
in
|
|
|
|
|
2020-01-12 19:52:40 +00:00
|
|
|
import ./make-test.nix rec {
|
|
|
|
name = "nix-bitcoin";
|
|
|
|
|
|
|
|
hardened = {
|
|
|
|
imports = [ <nixpkgs/nixos/modules/profiles/hardened.nix> ];
|
|
|
|
security.allowUserNamespaces = true; # reenable disabled option
|
|
|
|
};
|
|
|
|
|
|
|
|
machine = { pkgs, lib, ... }: with lib; {
|
|
|
|
imports = [
|
2020-04-07 20:47:32 +00:00
|
|
|
../modules/presets/secure-node.nix
|
2020-01-12 19:52:40 +00:00
|
|
|
../modules/secrets/generate-secrets.nix
|
|
|
|
# using the hardened profile increases total test duration by ~50%, so disable it for now
|
|
|
|
# hardened
|
|
|
|
];
|
|
|
|
|
2020-07-16 14:48:41 +00:00
|
|
|
nix-bitcoin.netns-isolation.enable = mkForce netns-isolation;
|
2020-06-18 10:22:44 +00:00
|
|
|
|
2020-01-12 19:52:40 +00:00
|
|
|
services.bitcoind.extraConfig = mkForce "connect=0";
|
|
|
|
|
|
|
|
services.clightning.enable = true;
|
|
|
|
services.spark-wallet.enable = true;
|
|
|
|
services.lightning-charge.enable = true;
|
|
|
|
services.nanopos.enable = true;
|
|
|
|
|
|
|
|
services.lnd.enable = true;
|
|
|
|
systemd.services.lnd.wantedBy = mkForce [];
|
2020-07-10 14:09:31 +00:00
|
|
|
services.lightning-loop.enable = true;
|
|
|
|
systemd.services.lightning-loop.wantedBy = mkForce [];
|
2020-01-12 19:52:40 +00:00
|
|
|
|
|
|
|
services.electrs.enable = true;
|
|
|
|
|
|
|
|
services.liquidd = {
|
|
|
|
enable = true;
|
|
|
|
listen = mkForce false;
|
|
|
|
extraConfig = "noconnect=1";
|
|
|
|
};
|
|
|
|
|
|
|
|
services.nix-bitcoin-webindex.enable = true;
|
|
|
|
|
|
|
|
services.hardware-wallets = {
|
|
|
|
trezor = true;
|
|
|
|
ledger = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
# to test that unused secrets are made inaccessible by 'setup-secrets'
|
|
|
|
systemd.services.generate-secrets.postStart = ''
|
|
|
|
install -o nobody -g nogroup -m777 <(:) /secrets/dummy
|
|
|
|
'';
|
|
|
|
};
|
2020-07-16 14:48:41 +00:00
|
|
|
testScript = builtins.readFile ./scenarios/lib.py + "\n\n" + builtins.readFile testScriptFilename;
|
2020-01-12 19:52:40 +00:00
|
|
|
}
|