summaryrefslogtreecommitdiff
path: root/modules/root/gitea.nix
diff options
context:
space:
mode:
authorTim Keller <tjk@tjkeller.xyz>2025-08-19 21:26:36 -0500
committerTim Keller <tjk@tjkeller.xyz>2025-08-19 21:26:36 -0500
commit95f86e629a073e3a8c473e2acd5f8b648413c68b (patch)
tree5989bc3843627dad5df6ff21b286efb77055b7cf /modules/root/gitea.nix
parent168eb276e6e16f377a8f5759d380f27d4b3d5b24 (diff)
downloadnixos-95f86e629a073e3a8c473e2acd5f8b648413c68b.tar.xz
nixos-95f86e629a073e3a8c473e2acd5f8b648413c68b.zip
move web services to services and expose web socket for searxng
Diffstat (limited to 'modules/root/gitea.nix')
-rw-r--r--modules/root/gitea.nix60
1 files changed, 0 insertions, 60 deletions
diff --git a/modules/root/gitea.nix b/modules/root/gitea.nix
deleted file mode 100644
index 32c56db..0000000
--- a/modules/root/gitea.nix
+++ /dev/null
@@ -1,60 +0,0 @@
-{ lib, pkgs, config, userDetails, ... }:
-let
- cfg = config.gitea;
-in {
- options = {
- gitea = {
- enable = lib.mkEnableOption "enables gitea service";
- hostAddress = lib.mkOption {
- type = lib.types.str;
- description = "hostAddress for the container";
- default = "10.0.1.1";
- };
- localAddress = lib.mkOption {
- type = lib.types.str;
- description = "localAddress for the container";
- default = "10.0.1.3";
- };
- };
- };
-
- config = lib.mkIf cfg.enable {
- containers.gitea = {
- autoStart = true;
- privateNetwork = true;
- hostAddress = cfg.hostAddress;
- localAddress = cfg.localAddress;
-
- config = { lib, config, ... }: {
- # Enable gitea service
- services.gitea = {
- enable = true;
- user = "git"; # So ssh cloning uses git@gitea
- settings = {
- server = {
- HTTP_PORT = 3000; # Can't set as 80 without root permissions, use 3000 instead
- };
- };
- };
-
- # Networking, etc.
- # Redirect 80 to 3000
- networking.nftables = {
- enable = true;
- ruleset = ''
- table ip nat {
- chain prerouting {
- type nat hook prerouting priority 0;
- tcp dport 80 redirect to :3000
- }
- }
- '';
- };
- networking.firewall.allowedTCPPorts = [ 3000 80 22 ]; # Still need to forward 3000 for nftables rule to work
- networking.hostName = "gitea";
-
- system.stateVersion = "25.05";
- };
- };
- };
-}