homeserver: added memos podman service

This commit is contained in:
Tigor Hutasuhut 2024-07-28 22:18:27 +07:00
parent 655960ee3c
commit 3e078a2d1b
4 changed files with 50 additions and 0 deletions

View file

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

View file

@ -38,6 +38,7 @@
servarr.rdtclient.enable = true;
openobserve.enable = true;
minecraft.enable = true;
memos.enable = true;
};
docker = {

View file

@ -41,6 +41,7 @@ in
# 10.88.0.6 -> Suwayomi Flaresolverr
# 10.88.1.1 -> Pihole
imports = [
./memos.nix
./minecraft.nix
./openobserve.nix
./pihole.nix

47
system/podman/memos.nix Normal file
View file

@ -0,0 +1,47 @@
{ config, lib, ... }:
let
name = "memos";
podman = config.profile.podman;
inherit (lib) mkIf;
ip = "10.88.88.1";
image = "docker.io/neosmemo/memos:stable";
rootVolume = "/nas/podman/memos";
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}:5230
'';
system.activationScripts."podman-${name}" = ''
mkdir -p ${rootVolume}
chown ${uid}:${gid} ${rootVolume}
'';
virtualisation.oci-containers.containers.${name} = {
inherit image;
hostname = name;
autoStart = true;
user = "${uid}:${gid}";
environment = {
TZ = "Asia/Jakarta";
# MEMOS_PUBLIC = "true";
};
volumes = [
"${rootVolume}:/var/opt/memos"
];
extraOptions = [
"--network=podman"
"--ip=${ip}"
];
labels = {
"io.containers.autoupdate" = "registry";
};
};
};
}