diff --git a/config/hosts/imxyy-nix-server/code.nix b/config/hosts/imxyy-nix-server/code.nix index cee2d66..b7f29ef 100644 --- a/config/hosts/imxyy-nix-server/code.nix +++ b/config/hosts/imxyy-nix-server/code.nix @@ -1,29 +1,10 @@ -{ config, ... }: { - services.postgresql.ensureUsers = [ - { - name = "coder"; - ensureDBOwnership = true; - } - ]; - services.postgresql.ensureDatabases = [ "coder" ]; - virtualisation.oci-containers.containers.coder = { - image = "ghcr.io/coder/coder:latest"; - environment = { - CODER_ACCESS_URL = "https://coder.imxyy.top"; - CODER_HTTP_ADDRESS = "0.0.0.0:8086"; - CODER_PG_CONNECTION_URL = "postgresql://coder:coderdatabase@127.0.0.1/coder?sslmode=disable"; - }; - extraOptions = [ - "--network=host" - "--group-add=${toString config.users.groups.podman.gid}" - ]; - volumes = [ - "/var/lib/coder:/home/coder/.config" - "/var/run/docker.sock:/var/run/docker.sock" - ]; - ports = [ "8086:8086" ]; + services.coder = { + enable = true; + accessUrl = "https://coder.imxyy.top"; + listenAddress = "127.0.0.1:8086"; }; + users.users.coder.extraGroups = [ "podman" ]; services.caddy.virtualHosts."coder.imxyy.top" = { extraConfig = '' reverse_proxy :8086 {