From 365d3e37359d202edb980e8d3d1ac81a59d3dfcf Mon Sep 17 00:00:00 2001 From: zuckerberg <5-zuckerberg@users.noreply.git.neet.dev> Date: Sun, 13 Jun 2021 14:02:20 -0400 Subject: [PATCH] use gitea instead of gitlab --- common/common.nix | 1 + common/server/gitea.nix | 34 +++++++++++++++++++++++++++++ machines/liza/configuration.nix | 5 +++++ machines/neet.dev/configuration.nix | 1 - 4 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 common/server/gitea.nix diff --git a/common/common.nix b/common/common.nix index 1f14ca6..40f3432 100644 --- a/common/common.nix +++ b/common/common.nix @@ -16,6 +16,7 @@ ./server/nginx-stream.nix ./server/matrix.nix ./server/zerobin.nix + ./server/gitea.nix ./server/privatebin/privatebin.nix ./pc/de.nix ]; diff --git a/common/server/gitea.nix b/common/server/gitea.nix new file mode 100644 index 0000000..08d8ce4 --- /dev/null +++ b/common/server/gitea.nix @@ -0,0 +1,34 @@ +{ lib, config, ... }: + +let + cfg = config.services.gitea; +in { + options.services.gitea = { + hostname = lib.mkOption { + type = lib.types.str; + example = "example.com"; + }; + }; + config = lib.mkIf cfg.enable { + services.gitea = { + domain = cfg.hostname; + ssh.enable = true; + # lfs.enable = true; + dump.enable = true; + cookieSecure = true; + disableRegistration = true; + settings = { + other = { + SHOW_FOOTER_VERSION = false; + }; + }; + }; + services.nginx.virtualHosts.${cfg.hostname} = { + enableACME = true; + forceSSL = true; + locations."/" = { + proxyPass = "http://localhost:${toString cfg.httpPort}"; + }; + }; + }; +} \ No newline at end of file diff --git a/machines/liza/configuration.nix b/machines/liza/configuration.nix index f35fc99..e4f35bf 100644 --- a/machines/liza/configuration.nix +++ b/machines/liza/configuration.nix @@ -20,6 +20,11 @@ device.path = "/dev/disk/by-uuid/2f736fba-8a0c-4fb5-8041-c849fb5e1297"; }; + services.gitea = { + enable = true; + hostname = "git.neet.dev"; + }; + networking.hostName = "liza"; networking.interfaces.enp1s0.useDHCP = true; diff --git a/machines/neet.dev/configuration.nix b/machines/neet.dev/configuration.nix index 176b71f..7dc9818 100644 --- a/machines/neet.dev/configuration.nix +++ b/machines/neet.dev/configuration.nix @@ -4,7 +4,6 @@ imports =[ ./hardware-configuration.nix ../../common/common.nix - ../../common/server/gitlab.nix ]; # wt6nczjfvtba6pvjt2qtevwjpq4gcbz46bwjz4hboehgecyqmzqgwnqd.onion