2021-06-01 10:57:12 +00:00
|
|
|
{ config, lib, pkg, ... }:
|
|
|
|
let
|
|
|
|
inherit (lib)
|
|
|
|
mkOption
|
|
|
|
types
|
|
|
|
;
|
|
|
|
|
|
|
|
cfg = config.virtualisation.podman.networkSocket;
|
|
|
|
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.virtualisation.podman.networkSocket = {
|
|
|
|
server = mkOption {
|
|
|
|
type = types.enum [ "ghostunnel" ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = lib.mkIf (cfg.enable && cfg.server == "ghostunnel") {
|
|
|
|
|
|
|
|
services.ghostunnel = {
|
|
|
|
enable = true;
|
|
|
|
servers."podman-socket" = {
|
|
|
|
inherit (cfg.tls) cert key cacert;
|
|
|
|
listen = "${cfg.listenAddress}:${toString cfg.port}";
|
|
|
|
target = "unix:/run/podman/podman.sock";
|
|
|
|
allowAll = lib.mkDefault true;
|
|
|
|
};
|
|
|
|
};
|
2022-08-21 13:32:41 +00:00
|
|
|
systemd.services.ghostunnel-server-podman-socket.serviceConfig.SupplementaryGroups = [ "podman" ];
|
2021-06-01 10:57:12 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
meta.maintainers = lib.teams.podman.members ++ [ lib.maintainers.roberth ];
|
|
|
|
}
|