Skip to content

Commit 736c208

Browse files
delafthirycee
authored andcommitted
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
1 parent f968ed5 commit 736c208

1 file changed

Lines changed: 22 additions & 1 deletion

File tree

modules/services/podman/darwin.nix

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,20 @@ in
198198
};
199199
};
200200
};
201+
202+
extraPackages = mkOption {
203+
type = types.listOf types.package;
204+
default = with pkgs; [
205+
openssh
206+
];
207+
defaultText = lib.literalExpression "[ pkgs.openssh ]";
208+
example = lib.literalExpression ''
209+
with pkgs; [ openssh hello ];
210+
'';
211+
description = ''
212+
Extra packages added to {env}`PATH` when creating Podman machines.
213+
'';
214+
};
201215
};
202216

203217
config =
@@ -263,7 +277,14 @@ in
263277
'';
264278
in
265279
lib.hm.dag.entryAfter [ "writeBoundary" ] ''
266-
PATH="${cfg.package}/bin:$PATH"
280+
PATH="${
281+
lib.makeBinPath (
282+
[
283+
cfg.package
284+
]
285+
++ cfg.extraPackages
286+
)
287+
}:$PATH"
267288
268289
${concatStringsSep "\n" (lib.mapAttrsToList mkMachineInitScript allMachines)}
269290

0 commit comments

Comments
 (0)