from my phone so i cant see the changes lol
This commit is contained in:
62
modules/containers/gotify/container.nix
Normal file
62
modules/containers/gotify/container.nix
Normal file
@@ -0,0 +1,62 @@
|
||||
{moduleWithSystem, ...}: {
|
||||
flake.nixosModules.containerGotify = moduleWithSystem ({pkgs, ...}: {
|
||||
virtualisation.oci-containers.containers."gotify-gotify" = {
|
||||
image = "gotify/server";
|
||||
environment = {
|
||||
};
|
||||
volumes = [
|
||||
"/containers/gotify/gotify_data:/app/data:rw"
|
||||
];
|
||||
ports = [
|
||||
"8088:80/tcp"
|
||||
];
|
||||
log-driver = "journald";
|
||||
extraOptions = [
|
||||
"--network-alias=gotify"
|
||||
"--network=gotify_default"
|
||||
];
|
||||
};
|
||||
systemd.services."podman-gotify-gotify" = {
|
||||
serviceConfig = {
|
||||
Restart = pkgs.lib.mkOverride 90 "always";
|
||||
};
|
||||
after = [
|
||||
"podman-network-gotify_default.service"
|
||||
];
|
||||
requires = [
|
||||
"podman-network-gotify_default.service"
|
||||
];
|
||||
partOf = [
|
||||
"podman-compose-gotify-root.target"
|
||||
];
|
||||
wantedBy = [
|
||||
"podman-compose-gotify-root.target"
|
||||
];
|
||||
};
|
||||
|
||||
# Networks
|
||||
systemd.services."podman-network-gotify_default" = {
|
||||
path = [pkgs.podman];
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
RemainAfterExit = true;
|
||||
ExecStop = "podman network rm -f gotify_default";
|
||||
};
|
||||
script = ''
|
||||
podman network inspect gotify_default || podman network create gotify_default
|
||||
'';
|
||||
partOf = ["podman-compose-gotify-root.target"];
|
||||
wantedBy = ["podman-compose-gotify-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-gotify-root" = {
|
||||
unitConfig = {
|
||||
Description = "Root target generated by compose2nix.";
|
||||
};
|
||||
wantedBy = ["multi-user.target"];
|
||||
};
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user