This commit is contained in:
Elnu 2025-03-26 10:42:37 -07:00
parent e5f2d96e8e
commit 806b368f55
4 changed files with 36 additions and 12 deletions

View file

@ -16,7 +16,6 @@
};
nixpkgs.config.allowUnfree = true;
programs.git.enable = true;
nix = {
package = pkgs.nixVersions.stable; # flakes
@ -25,13 +24,8 @@
networking = {
networkmanager.enable = true;
# networking.nameservers doesn't apply to resolvconf
# nameservers = [ "9.9.9.9" "1.1.1.1" ];
resolvconf.extraConfig = "name_servers=\"9.9.9.9 1.1.1.1\"";
# Temporary since MagicDNS is broken
hosts = {
"192.168.1.168" = [ "elnuhub.local" ];
};
resolvconf.enable = true;
# DNS servers managed by tailscale
};
# This value determines the NixOS release from which the default

View file

@ -1,4 +1,4 @@
{ lib, modulesPath, user, ... }:
{ lib, modulesPath, enableSSL, user, pkgs, ... }:
{
imports = lib.optional (builtins.pathExists ./do-userdata.nix) ./do-userdata.nix ++ [
@ -16,9 +16,15 @@
./hosts/git.elnu.com
#./hosts/jichan.org
#./hosts/tegakituesday.com
./hosts/atlantapaversinc.com
];
fileSystems."/mnt/data" = { device = "/dev/sda"; fsType = "ext4"; };
programs.git.enable = true;
environment.systemPackages = with pkgs; [
hugo
];
networking = {
# May cause some issues
#networkmanager.enable = lib.mkForce false;
@ -35,14 +41,14 @@
services.nginx = {
enable = true;
/*
user = "forgejo"; # prevent 403 Forbidden error
virtualHosts."default" = {
default = true;
rejectSSL = true;
serverName = null;
# https://stackoverflow.com/a/42802777
locations."/".return = "444";
};
*/
};
#services.do-agent.enable = true;

View file

@ -0,0 +1,18 @@
{ config, pkgs, lib, enableSSL, ... }:
let
host = "atlantapaversinc.com";
in {
services.nginx.virtualHosts."www.${host}" = {
forceSSL = enableSSL;
enableACME = enableSSL;
globalRedirect = host;
};
services.nginx.virtualHosts."${host}" = {
forceSSL = enableSSL;
enableACME = enableSSL;
locations = {
"/".root = "/mnt/data/forgejo/sites/atlantapaversinc.com/public";
};
};
}

View file

@ -22,12 +22,18 @@ in {
service = {
DISABLE_REGISTRATION = true;
};
security = {
DISABLE_GIT_HOOKS = false;
};
git = {
# https://github.com/go-gitea/gitea/issues/10103#issuecomment-622222129
GC_ARGS = "--aggressive --auto";
};
};
};
services.nginx.virtualHosts."${host}" = {
forceSSL = enableSSL;
enableACME = enableSSL;
default = true;
locations = {
"/".proxyPass = "http://localhost:${builtins.toString port}";
};