From 65c08ae74762902bf26907864992db19c6e2e342 Mon Sep 17 00:00:00 2001 From: Christoph Schmatzler Date: Thu, 11 Dec 2025 20:17:57 +0000 Subject: [PATCH] refactor --- hosts/michael/default.nix | 27 +-------------------------- modules/gitea.nix | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 26 deletions(-) create mode 100644 modules/gitea.nix diff --git a/hosts/michael/default.nix b/hosts/michael/default.nix index 3042ca0..ce6e5db 100644 --- a/hosts/michael/default.nix +++ b/hosts/michael/default.nix @@ -13,6 +13,7 @@ ./disk-config.nix ./hardware-configuration.nix ../../modules/core.nix + ../../modules/gitea.nix ../../modules/nixos.nix inputs.disko.nixosModules.disko ]; @@ -44,32 +45,6 @@ ]; }; - networking.firewall.allowedTCPPorts = [80 443]; - - services.gitea = { - enable = true; - database = { - type = "sqlite3"; - path = "/var/lib/gitea/data/gitea.db"; - }; - settings = { - server = { - ROOT_URL = "https://git.schmatzler.com/"; - DOMAIN = "git.schmatzler.com"; - HTTP_ADDR = "127.0.0.1"; - HTTP_PORT = 3000; - }; - service.DISABLE_REGISTRATION = true; - }; - }; - - services.caddy = { - enable = true; - virtualHosts."git.schmatzler.com".extraConfig = '' - reverse_proxy localhost:3000 - ''; - }; - services.openssh = { enable = true; settings = { diff --git a/modules/gitea.nix b/modules/gitea.nix new file mode 100644 index 0000000..b140ed1 --- /dev/null +++ b/modules/gitea.nix @@ -0,0 +1,27 @@ +{...}: { + networking.firewall.allowedTCPPorts = [80 443]; + + services.gitea = { + enable = true; + database = { + type = "sqlite3"; + path = "/var/lib/gitea/data/gitea.db"; + }; + settings = { + server = { + ROOT_URL = "https://git.schmatzler.com/"; + DOMAIN = "git.schmatzler.com"; + HTTP_ADDR = "127.0.0.1"; + HTTP_PORT = 3000; + }; + service.DISABLE_REGISTRATION = true; + }; + }; + + services.caddy = { + enable = true; + virtualHosts."git.schmatzler.com".extraConfig = '' + reverse_proxy localhost:3000 + ''; + }; +}