diff --git a/ServeNix/configuration.nix b/ServeNix/configuration.nix index a615650..3b4ee97 100644 --- a/ServeNix/configuration.nix +++ b/ServeNix/configuration.nix @@ -14,6 +14,7 @@ # Include Services ./services/authelia.nix ./services/fileflows.nix + ./services/gitea.nix ./services/homepage.nix ./services/hydra.nix ./services/jellyfin.nix diff --git a/ServeNix/services/gitea.nix b/ServeNix/services/gitea.nix new file mode 100644 index 0000000..254e8a4 --- /dev/null +++ b/ServeNix/services/gitea.nix @@ -0,0 +1,67 @@ +{ + config, + lib, + pkgs, + ... +}: { + virtualisation.oci-containers.containers.gitea-db = { + image = "postgres:14"; + autoStart = true; + + dependsOn = []; + + ports = []; + + volumes = [ + "gitea-db_data:/var/lib/postgresql/data" + ]; + + environment = { + POSTGRES_USER = "gitea"; + POSTGRES_PASSWORD = "gitea"; + POSTGRES_DB = "gitea"; + }; + + extraOptions = [ + "--network=behind-nginx" + ]; + }; + + virtualisation.oci-containers.containers.gitea = { + image = "gitea/gitea:latest"; + autoStart = true; + + dependsOn = [ + "gitea-db" + ]; + + ports = [ + "3000:3000" + # "222:22" + ]; + + volumes = [ + "/etc/timezone:/etc/timezone:ro" + "/etc/localtime:/etc/localtime:ro" + + "gitea_data:/data" + ]; + + environment = { + USER = "christoph"; + USER_UID = "1000"; + USER_GID = "100"; + + GITEA__database__DB_TYPE = "postgres"; + GITEA__database__HOST = "gitea-db:5432"; + GITEA__database__NAME = "gitea"; + GITEA__database__USER = "gitea"; + GITEA__database__PASSWD = "gitea"; + + }; + + extraOptions = [ + "--network=behind-nginx" + ]; + }; +}