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