From dff837606b9b8c55e5c44cf903bd0f8724cc4e91 Mon Sep 17 00:00:00 2001 From: cy Date: Tue, 17 Dec 2024 00:55:28 -0500 Subject: [PATCH] init --- hosts/chunk/default.nix | 14 ++++++++++++-- hosts/chunk/ghost.nix | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 hosts/chunk/ghost.nix diff --git a/hosts/chunk/default.nix b/hosts/chunk/default.nix index 94d384a..1de5cdc 100644 --- a/hosts/chunk/default.nix +++ b/hosts/chunk/default.nix @@ -21,6 +21,7 @@ ./wireguard.nix ./grafana.nix ./tor.nix + ./ghost.nix ]; sops.age.keyFile = "/root/.config/sops/age/keys.txt"; @@ -126,7 +127,7 @@ users.users.yt = { isNormalUser = true; - extraGroups = ["wheel" "networkmanager" "docker"]; + extraGroups = ["wheel" "networkmanager" "podman"]; openssh.authorizedKeys.keys = ["ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPdhAQYy0+vS+QmyCd0MAbqbgzyMGcsuuFyf6kg2yKge yt@ytlinux"]; shell = pkgs.zsh; }; @@ -170,5 +171,14 @@ logFormat = lib.mkForce "level INFO"; }; - virtualisation.docker.enable = true; + # container stuff + virtualisation.container.enable = true; + vrtualisation.podman = { + enable = true; + # create 'docker' alias for podman, to use as + # drop-in replacement + dockerCompat = true; + defaultNetwork.settings.dns_enabled = true; + }; + virtualisation.oci-containers.backend = "podman"; } diff --git a/hosts/chunk/ghost.nix b/hosts/chunk/ghost.nix new file mode 100644 index 0000000..24ced0e --- /dev/null +++ b/hosts/chunk/ghost.nix @@ -0,0 +1,37 @@ +{...}: { + virtualisation.oci-containers.containers.ghost = { + imgage = "ghost:5-alpine"; + autoStart = true; + ports = ["127.0.0.1:8084:2368"]; + pull = "always"; + environment = { + database__client = "mysql"; + database__connection__host = "ghost-db"; + database__connection__user = "root"; + database__connection__password = "example"; + database__connection__databse = "ghost"; + url = "https://cything.io"; + NODE_ENV = "production"; + }; + volumes = [ + "/opt/ghost/data:/var/lib/ghost/content" + ]; + networks = [ + "ghost-net" + ]; + }; + + virtualisation.oci-containers.containers.ghost-db = { + image = "mysql:8.0"; + autoStart = true; + environment = { + MYSQL_ROOT_PASSWORD = "example"; + }; + volumes = [ + "/opt/ghost/db:/var/lib/mysql" + ]; + networks = [ + "ghost-net" + ]; + }; +}