blumeops/containers/nettest/default.nix
Erich Blume 514a797067
Some checks failed
Build Container / build (push) Has been skipped
Build Container (Nix) / build (push) Failing after 2s
Fix nix container build: resolve nixpkgs from flake registry
The runner service doesn't have NIX_PATH set, so <nixpkgs> fails.
Add a step to resolve nixpkgs from the flake registry and set NIX_PATH.
Also switch to nix-build (legacy CLI) and stop hardcoding aarch64-linux
in default.nix.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 08:04:42 -08:00

38 lines
853 B
Nix

# Nix-built nettest container
# Equivalent to the Dockerfile: curl, jq, bind (nslookup), ca-certs, bash
# Built with dockerTools.buildLayeredImage for efficient layer caching
{ pkgs ? import <nixpkgs> { } }:
let
testScript = ./test-connectivity.sh;
tools = pkgs.buildEnv {
name = "nettest-tools";
paths = [
pkgs.curl
pkgs.jq
pkgs.dnsutils # provides nslookup, dig
pkgs.cacert
pkgs.coreutils
pkgs.bashInteractive
];
};
in
pkgs.dockerTools.buildLayeredImage {
name = "blumeops/nettest";
tag = "latest";
contents = [ tools ];
extraCommands = ''
cp ${testScript} test-connectivity.sh
chmod +x test-connectivity.sh
'';
config = {
Entrypoint = [ "/bin/bash" "/test-connectivity.sh" ];
Env = [
"SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"
];
};
}