podman: added podman morphos service

This commit is contained in:
Tigor Hutasuhut 2024-08-09 22:10:25 +07:00
parent 0e1dfa5f70
commit 1e9efb4081
4 changed files with 43 additions and 0 deletions

View file

@ -15,6 +15,7 @@ in
openobserve.enable = lib.mkEnableOption "openobserve podman";
minecraft.enable = mkEnableOption "minecraft server podman";
memos.enable = mkEnableOption "memos podman";
morphos.enable = mkEnableOption "morphos podman";
servarr = {
enable = mkEnableOption "servarr group";

View file

@ -39,6 +39,7 @@
openobserve.enable = true;
minecraft.enable = true;
memos.enable = true;
morphos.enable = true;
};
docker = {

View file

@ -43,6 +43,7 @@ in
imports = [
./memos.nix
./minecraft.nix
./morphos.nix
./openobserve.nix
./pihole.nix
./qbittorrent.nix

40
system/podman/morphos.nix Normal file
View file

@ -0,0 +1,40 @@
{ config, lib, ... }:
let
name = "morphos";
podman = config.profile.podman;
inherit (lib) mkIf;
ip = "10.88.88.2";
image = "ghcr.io/danvergara/morphos-server:latest";
domain = "${name}.tigor.web.id";
user = config.profile.user;
uid = toString user.uid;
gid = toString user.gid;
in
{
config = mkIf (podman.enable && podman.${name}.enable) {
services.caddy.virtualHosts.${domain}.extraConfig = ''
reverse_proxy ${ip}:8080
'';
virtualisation.oci-containers.containers.${name} = {
inherit image;
hostname = name;
autoStart = true;
user = "${uid}:${gid}";
environment = {
TZ = "Asia/Jakarta";
};
volumes = [
"/tmp:/tmp"
];
extraOptions = [
"--network=podman"
"--ip=${ip}"
];
labels = {
"io.containers.autoupdate" = "registry";
};
};
};
}