From d9747c64b038943253eaafdc59a49d5face46dab Mon Sep 17 00:00:00 2001 From: Fuwn Date: Fri, 20 Sep 2024 05:36:20 -0700 Subject: modules: server and core modules --- modules/server/virtualisation.nix | 76 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 modules/server/virtualisation.nix (limited to 'modules/server/virtualisation.nix') diff --git a/modules/server/virtualisation.nix b/modules/server/virtualisation.nix new file mode 100644 index 0000000..3d8effe --- /dev/null +++ b/modules/server/virtualisation.nix @@ -0,0 +1,76 @@ +{ secrets, ... }: +let + containerEngine = "podman"; +in +{ + virtualisation = { + containers.enable = true; + docker.enable = containerEngine == "docker"; + + podman = { + enable = containerEngine == "podman"; + dockerCompat = true; + defaultNetwork.settings.dns_enabled = true; + }; + + oci-containers = { + backend = containerEngine; + + containers = { + september = { + image = "fuwn/september"; + autoStart = true; + ports = [ "8084:80" ]; + + environment = { + CONDENSE_LINKS_AT_HEADINGS = "## Quick Links,# Fuwn[.me],## Footer"; + EMBED_IMAGES = "2"; + HEAD = ''''; + MATHJAX = "true"; + PLAIN_TEXT_ROUTE = "*.xml,*.txt"; + PRIMARY_COLOUR = "#DCC6BD"; + }; + }; + + momoka = { + image = "fuwn/momoka"; + autoStart = true; + ports = [ "70:70" ]; + }; + + gigi = { + image = "fuwn/gigi"; + autoStart = true; + ports = [ "79:79" ]; + volumes = [ "/mnt/docker/gigi:/gigi/.gigi" ]; + }; + + mayu = { + image = "fuwn/mayu"; + autoStart = true; + ports = [ "8098:3000" ]; + volumes = [ "/mnt/docker/mayu:/mayu/data" ]; + }; + + locus = { + image = "ghcr.io/gemrest/locus"; + autoStart = true; + ports = [ "1965:1965" ]; + volumes = [ "/mnt/docker/locus:/locus/.locus" ]; + + environment = { + FINNHUB_TOKEN = secrets.finnhub_token; + HEADER_IMAGE = "https://ruu.neocities.org/images/animeHeader.gif"; + }; + }; + + bin = { + image = "quxfoo/wastebin"; + autoStart = true; + ports = [ "8090:8088" ]; + volumes = [ "/mnt/docker/bin:/root/db" ]; + }; + }; + }; + }; +} -- cgit v1.2.3