podman: ensure openssh is available in PATH

Specifically, the machine initialization command `podman machine init`
requires `ssh-keygen` to generate keys, but `openssh` may not be
available in the system `PATH` by default. This change ensures
`openssh` is available before attempting to create podman machines.

Resolves #9325
This commit is contained in:
Thierry Delafontaine
2026-05-15 21:11:10 +02:00
committed by Robert Helgesson
parent f968ed5961
commit 736c2084ea

View File

@@ -198,6 +198,20 @@ in
};
};
};
extraPackages = mkOption {
type = types.listOf types.package;
default = with pkgs; [
openssh
];
defaultText = lib.literalExpression "[ pkgs.openssh ]";
example = lib.literalExpression ''
with pkgs; [ openssh hello ];
'';
description = ''
Extra packages added to {env}`PATH` when creating Podman machines.
'';
};
};
config =
@@ -263,7 +277,14 @@ in
'';
in
lib.hm.dag.entryAfter [ "writeBoundary" ] ''
PATH="${cfg.package}/bin:$PATH"
PATH="${
lib.makeBinPath (
[
cfg.package
]
++ cfg.extraPackages
)
}:$PATH"
${concatStringsSep "\n" (lib.mapAttrsToList mkMachineInitScript allMachines)}