Rename go-workspace to just entrypoint, clean out unused wait-for tools

This commit is contained in:
Brian Picciano 2022-10-20 22:06:22 +02:00
parent 47e45e0071
commit 5e399209b2
40 changed files with 16 additions and 62 deletions

View File

@ -1,9 +0,0 @@
ip="$1"
shift;
echo "waiting for $ip to become available..."
while true; do ping -c1 -W1 "$ip" &> /dev/null && break; done
exec "$@"

View File

@ -44,7 +44,7 @@
'';
};
goWorkspace = pkgs.callPackage ./go-workspace {};
entrypoint = pkgs.callPackage ./entrypoint {};
dnsmasq = (pkgs.callPackage ./dnsmasq {
glibcStatic = pkgs.glibc.static;
@ -60,8 +60,6 @@
pkgs.pkgsStatic.bash
pkgs.pkgsStatic.coreutils
pkgs.pkgsStatic.unixtools.ping
pkgs.pkgsStatic.netcat # required by waitFor
pkgs.pkgsStatic.gnutar
pkgs.pkgsStatic.gzip
@ -73,8 +71,7 @@
version
dnsmasq
garage
waitFor
goWorkspace.entrypoint
entrypoint
] ++ (if bootstrap != null then [ rootedBootstrap ] else []);
};

14
entrypoint/default.nix Normal file
View File

@ -0,0 +1,14 @@
{
buildGoModule,
}: buildGoModule {
pname = "cryptic-net-entrypoint";
version = "unstable";
src = ./src;
vendorSha256 = "sha256-URmrK9Sd/5yhXrWxXZq05TS7aY7IWptQFMKfXKJY7Hc=";
subPackages = [
"cmd/entrypoint"
];
}

View File

@ -1,9 +0,0 @@
# go-workspace
This module is used for building all custom go binaries within the cryptic-net
project.
The reason binaries are contained here, and not under the sub-directory for the
sub-process the correspond to like most other code in this project, is that nix
makes it difficult to compose multiple modules defined locally. If nix ever
fixes this we should split this out.

View File

@ -1,18 +0,0 @@
{
buildGoModule,
}: let
build = subPackage: buildGoModule {
pname = "cryptic-net-" + (builtins.baseNameOf subPackage);
version = "unstable";
src = ./src;
vendorSha256 = "sha256-URmrK9Sd/5yhXrWxXZq05TS7aY7IWptQFMKfXKJY7Hc=";
subPackages = [
subPackage
];
};
in {
entrypoint = build "cmd/entrypoint";
}

View File

@ -1,21 +0,0 @@
{
fetchFromGitHub,
stdenv,
}: stdenv.mkDerivation rec {
pname = "cryptic-net-wait-for";
version = "2.2.2";
src = fetchFromGitHub {
owner = "eficode";
repo = "wait-for";
rev = "v${version}";
sha256 = "sha256-qYeBOF63/+8bbFHiR6HT2mMQDFKCVkLNzIGLeEZJ4sk=";
};
builder = builtins.toFile "builder.sh" ''
source $stdenv/setup
mkdir -p "$out"/bin
cp "$src"/wait-for "$out"/bin/
'';
}