2021-05-25 08:15:22 +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" ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-05-31 12:57:39 +00:00
|
|
|
config = lib.mkIf (cfg.enable && cfg.server == "ghostunnel") {
|
2021-05-25 08:15:22 +00:00
|
|
|
|
2021-05-31 12:57:39 +00:00
|
|
|
services.ghostunnel = {
|
2021-05-25 08:15:22 +00:00
|
|
|
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;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
systemd.services.ghostunnel-server-podman-socket.serviceConfig.SupplementaryGroups = ["podman"];
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
meta.maintainers = lib.teams.podman.members ++ [ lib.maintainers.roberth ];
|
|
|
|
}
|