my nix configs for my servers and desktop
1{ lib, pkgs, config, ... }: 2 3with lib; 4let 5 cfg = config.modules.forgejo; 6 sshPort = 2222; 7 httpPort = 5000; 8in 9{ 10 options = { 11 modules = { 12 forgejo = { 13 enable = mkEnableOption "Deploy forgejo"; 14 }; 15 }; 16 }; 17 18 config = mkIf cfg.enable { 19 networking.firewall.allowedTCPPorts = [ 20 sshPort 21 httpPort 22 ]; 23 24 services.forgejo = { 25 enable = true; 26 database = { 27 type = "sqlite3"; 28 path = "/var/lib/forgejo/forgejo.db"; 29 }; 30 lfs.enable = true; 31 settings = { 32 server = { 33 domain = "git.nekomimi.pet"; 34 ROOT_URL = "https://git.nekomimi.pet"; 35 LANDING_PAGE = "explore"; 36 HTTP_PORT = 5000; 37 SSH_LISTEN_PORT = 2222; 38 SSH_PORT = 2222; 39 START_SSH_SERVER = true; 40 SSH_DOMAIN = "sgit.nekomimi.pet"; 41 }; 42 service.DISABLE_REGISTRATION = true; 43 actions = { 44 ENABLED = true; 45 DEFAULT_ACTIONS_URL = "github"; 46 }; 47 }; 48 }; 49 }; 50}