2020-10-18 04:41:57 -07:00
|
|
|
#!/usr/bin/env bash
|
2022-08-16 12:00:00 -07:00
|
|
|
set -euo pipefail
|
2020-10-18 04:41:57 -07:00
|
|
|
|
2021-09-23 07:51:34 -07:00
|
|
|
tmpDir=$(mktemp -d /tmp/nix-bitcoin-minimal-container.XXX)
|
2022-08-16 12:00:00 -07:00
|
|
|
trap 'rm -rf $tmpDir' EXIT
|
2021-09-23 07:51:34 -07:00
|
|
|
|
2023-01-03 10:36:27 -08:00
|
|
|
cd "${BASH_SOURCE[0]%/*}"
|
|
|
|
|
2021-09-23 07:51:34 -07: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 12:00:00 -07:00
|
|
|
' > "$tmpDir/importable-configuration.nix"
|
2021-09-23 07:51:34 -07:00
|
|
|
|
2022-08-16 12:00:00 -07:00
|
|
|
cat > "$tmpDir/configuration.nix" <<EOF
|
2021-09-23 07:51:34 -07: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 10:36:27 -08:00
|
|
|
./deploy-container.sh "$tmpDir/configuration.nix" "$@"
|