images
lib.images.pinned
The upstream images pinned in a Dockerfile, as image archives for
homelab.cluster.images. Dependabot bumps the FROM name:tag@digest
lines; their Nix hashes are in images.lock next to the Dockerfile,
which nix run github:nixos-homelab/shared#lock-images updates. The
tag gets the digest's first 12 hex digits, so a bump changes the pod
spec and rolls the workload. Each archive's ref is its name:tag.
Arguments
pkgs: nixpkgs
dockerfile (Path): Dockerfile with one FROM line per image
Example
let
redis = (images.pinned pkgs ./Dockerfile).redis;
in
{
homelab.cluster.images = [ redis ];
# ...
image = redis.ref;
imagePullPolicy = "Never";
}
lib.images.locked
Image archives for refs that something upstream names (a chart, another
module), locked to a digest and hash in lockFile, which
lock-images --lock FILE REF... writes. Returns the archives for
homelab.cluster.images and refFor, which maps each ref to its archive's
name:tag (the tag suffixed with the digest's first 12 hex digits).
As with lib.pins.locked, the refs have to come from the flake that holds
lockFile, or from the flake that ships lockFile with them (k8sss'
lib.imageLock): refs from an input a consumer can override go stale
against a lock kept here.
Arguments
pkgs: nixpkgs
lockFile (Path): JSON of ref to { digest, hash }
refs ([String]): image refs, with or without a digest
lib.images.chart
A rendered manifest (a Helm chart's, say) with every image: ref
replaced by its locked archive, see locked. Reading the manifest
builds it during evaluation. Returns manifest, images and refs
(what the manifest names, for lock-images --lock).
Arguments
pkgs: nixpkgs
lockFile (Path): JSON of ref to { digest, hash }
manifest (Path): the rendered manifest