feat(server/coder): use services.coder
This commit is contained in:
@@ -1,29 +1,10 @@
|
|||||||
{ config, ... }:
|
|
||||||
{
|
{
|
||||||
services.postgresql.ensureUsers = [
|
services.coder = {
|
||||||
{
|
enable = true;
|
||||||
name = "coder";
|
accessUrl = "https://coder.imxyy.top";
|
||||||
ensureDBOwnership = true;
|
listenAddress = "127.0.0.1:8086";
|
||||||
}
|
|
||||||
];
|
|
||||||
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" ];
|
|
||||||
};
|
};
|
||||||
|
users.users.coder.extraGroups = [ "podman" ];
|
||||||
services.caddy.virtualHosts."coder.imxyy.top" = {
|
services.caddy.virtualHosts."coder.imxyy.top" = {
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
reverse_proxy :8086 {
|
reverse_proxy :8086 {
|
||||||
|
|||||||
Reference in New Issue
Block a user