2020-10-18 11:41:57 +00:00
|
|
|
#!/usr/bin/env bash
|
2022-08-16 19:00:00 +00:00
|
|
|
set -euo pipefail
|
2020-10-18 11:41:57 +00:00
|
|
|
|
2021-09-23 14:51:34 +00:00
|
|
|
tmpDir=$(mktemp -d /tmp/nix-bitcoin-minimal-container.XXX)
|
2022-08-16 19:00:00 +00:00
|
|
|
trap 'rm -rf $tmpDir' EXIT
|
2021-09-23 14:51:34 +00:00
|
|
|
|
2023-01-03 18:36:27 +00:00
|
|
|
cd "${BASH_SOURCE[0]%/*}"
|
|
|
|
|
2021-09-23 14:51:34 +00:00
|
|
|
# Modify importable-configuration.nix to use the local <nix-bitcoin>
|
|
|
|
# source instead of fetchTarball
|
|
|
|
<importable-configuration.nix sed '
|
|
|
|
s|nix-bitcoin = .*|nix-bitcoin = toString <nix-bitcoin>;|;
|
|
|
|
s|system.extraDependencies = .*||
|
2022-08-16 19:00:00 +00:00
|
|
|
' > "$tmpDir/importable-configuration.nix"
|
2021-09-23 14:51:34 +00:00
|
|
|
|
2022-08-16 19:00:00 +00:00
|
|
|
cat > "$tmpDir/configuration.nix" <<EOF
|
2021-09-23 14:51:34 +00:00
|
|
|
{
|
|
|
|
imports = [ $tmpDir/importable-configuration.nix ];
|
|
|
|
users.users.main = {
|
|
|
|
isNormalUser = true;
|
|
|
|
password = "a";
|
|
|
|
};
|
|
|
|
# When WAN is disabled, DNS bootstrapping slows down service startup by ~15 s
|
|
|
|
services.clightning.extraConfig = "disable-dns";
|
|
|
|
}
|
|
|
|
EOF
|
|
|
|
|
2023-01-03 18:36:27 +00:00
|
|
|
./deploy-container.sh "$tmpDir/configuration.nix" "$@"
|