added warpgate (very cool)
This commit is contained in:
@@ -19,6 +19,7 @@
|
|||||||
containerNginxHomeAssistant
|
containerNginxHomeAssistant
|
||||||
containerSilverbullet
|
containerSilverbullet
|
||||||
containerPaperless
|
containerPaperless
|
||||||
|
containerWarpgate
|
||||||
];
|
];
|
||||||
in {
|
in {
|
||||||
imports = modules;
|
imports = modules;
|
||||||
|
|||||||
63
modules/containers/warpgate/container.nix
Normal file
63
modules/containers/warpgate/container.nix
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
{moduleWithSystem, ...}: {
|
||||||
|
flake.nixosModules.containerWarpgate = moduleWithSystem ({pkgs, ...}: {
|
||||||
|
virtualisation.oci-containers.containers."warpgate-warpgate" = {
|
||||||
|
image = "ghcr.io/warp-tech/warpgate";
|
||||||
|
volumes = [
|
||||||
|
"/containers/warpgate/data:/data:rw"
|
||||||
|
];
|
||||||
|
ports = [
|
||||||
|
"2222:2222/tcp"
|
||||||
|
"8888:8888/tcp"
|
||||||
|
"33306:33306/tcp"
|
||||||
|
];
|
||||||
|
log-driver = "journald";
|
||||||
|
# cmd = ["warpgate" "--skip-securing-files"];
|
||||||
|
extraOptions = [
|
||||||
|
"--network-alias=warpgate"
|
||||||
|
"--network=warpgate_default"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
systemd.services."podman-warpgate-warpgate" = {
|
||||||
|
serviceConfig = {
|
||||||
|
Restart = pkgs.lib.mkOverride 90 "always";
|
||||||
|
};
|
||||||
|
after = [
|
||||||
|
"podman-network-warpgate_default.service"
|
||||||
|
];
|
||||||
|
requires = [
|
||||||
|
"podman-network-warpgate_default.service"
|
||||||
|
];
|
||||||
|
partOf = [
|
||||||
|
"podman-compose-warpgate-root.target"
|
||||||
|
];
|
||||||
|
wantedBy = [
|
||||||
|
"podman-compose-warpgate-root.target"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
# Networks
|
||||||
|
systemd.services."podman-network-warpgate_default" = {
|
||||||
|
path = [pkgs.podman];
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "oneshot";
|
||||||
|
RemainAfterExit = true;
|
||||||
|
ExecStop = "podman network rm -f warpgate_default";
|
||||||
|
};
|
||||||
|
script = ''
|
||||||
|
podman network inspect warpgate_default || podman network create warpgate_default
|
||||||
|
'';
|
||||||
|
partOf = ["podman-compose-warpgate-root.target"];
|
||||||
|
wantedBy = ["podman-compose-warpgate-root.target"];
|
||||||
|
};
|
||||||
|
|
||||||
|
# Root service
|
||||||
|
# When started, this will automatically create all resources and start
|
||||||
|
# the containers. When stopped, this will teardown all resources.
|
||||||
|
systemd.targets."podman-compose-warpgate-root" = {
|
||||||
|
unitConfig = {
|
||||||
|
Description = "Root target generated by compose2nix.";
|
||||||
|
};
|
||||||
|
wantedBy = ["multi-user.target"];
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user