- Extract imds-server derivation into common/imds-server.nix so both ec2-image.nix and common/ec2.nix share the same definition. - Update common/ec2.nix (makeEc2Test) to use the IMDSv2 server instead of micro_httpd, and add token/instance-id to the metadata directory so the full IMDSv2 flow works. - Simplify ec2-image.nix to import from the shared definition.
5 lines
259 B
Nix
5 lines
259 B
Nix
# Minimal IMDSv2-compatible metadata server for NixOS EC2 tests.
|
|
# Runs in inetd mode (stdin/stdout), drop-in for micro_httpd in
|
|
# QEMU guestfwd and socat contexts.
|
|
{ pkgs }: pkgs.writers.writePython3Bin "imds-server" { } (builtins.readFile ./imds-server.py)
|