elnudrop: get git.elnu.com working

This commit is contained in:
Elnu 2025-03-22 17:18:25 -07:00
parent bbbea14c45
commit e5f2d96e8e
4 changed files with 41 additions and 0 deletions

View file

@ -16,6 +16,7 @@
};
nixpkgs.config.allowUnfree = true;
programs.git.enable = true;
nix = {
package = pkgs.nixVersions.stable; # flakes

View file

@ -13,9 +13,11 @@
#./modules/headscale.nix
./modules/tailscale.nix
./hosts/git.elnu.com
#./hosts/jichan.org
#./hosts/tegakituesday.com
];
fileSystems."/mnt/data" = { device = "/dev/sda"; fsType = "ext4"; };
networking = {
# May cause some issues
@ -33,12 +35,14 @@
services.nginx = {
enable = true;
/*
virtualHosts."default" = {
default = true;
serverName = null;
# https://stackoverflow.com/a/42802777
locations."/".return = "444";
};
*/
};
#services.do-agent.enable = true;

View file

@ -6,4 +6,5 @@
boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "xen_blkfront" "vmw_pvscsi" ];
boot.initrd.kernelModules = [ "nvme" ];
fileSystems."/" = { device = "/dev/vda1"; fsType = "ext4"; };
fileSystems."/mnt/data" = { device = "/dev/sda"; fsType = "ext4" };
}

View file

@ -0,0 +1,35 @@
{ config, pkgs, lib, enableSSL, ... }:
let
host = "git.elnu.com";
port = 3000;
in {
services.forgejo = {
package = pkgs.forgejo; # Don't use LTS
enable = true;
stateDir = "/mnt/data/forgejo";
settings = {
server = {
HTTP_PORT = port;
DOMAIN = host;
SSH_DOMAIN = host;
# security keys will get messed up if this isn't set exactly
# will default to http://git.elnu.com:3000/ otherwise
ROOT_URL = "https://${host}/";
# make gravatar etc work
OFFLINE_MODE = false;
};
service = {
DISABLE_REGISTRATION = true;
};
};
};
services.nginx.virtualHosts."${host}" = {
forceSSL = enableSSL;
enableACME = enableSSL;
default = true;
locations = {
"/".proxyPass = "http://localhost:${builtins.toString port}";
};
};
}