nixos/podman-network-socket-ghostunnel: init

(cherry picked from commit b6570e723836167640c9b7efc63f327ff17b0755)
This commit is contained in:
Robert Hensing
2021-06-02 10:20:10 +02:00
parent ffde2bb4a1
commit 833b005e37
5 changed files with 191 additions and 1 deletions
@@ -0,0 +1,34 @@
{ 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 = {
services.ghostunnel = lib.mkIf (cfg.enable && cfg.server == "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;
};
};
systemd.services.ghostunnel-server-podman-socket.serviceConfig.SupplementaryGroups = ["podman"];
};
meta.maintainers = lib.teams.podman.members ++ [ lib.maintainers.roberth ];
}