oracle rice

This commit is contained in:
iofq 2025-09-25 23:04:20 -05:00
parent 33fe28a76b
commit 3d3ae9c9b5
6 changed files with 125 additions and 16 deletions

View file

@ -2,13 +2,18 @@
{
imports = [
./hardware-configuration.nix
./forgejo.nix
];
boot.tmp.cleanOnBoot = true;
boot.kernel.sysctl = {
"net.ipv4.ip_forward" = 1;
"net.ipv6.conf.all.forwarding" = 1;
};
zramSwap.enable = true;
swapDevices = [
{
device = "/swapfile";
size = 16 * 1024;
size = 2 * 1024;
}
];
services = {
@ -29,12 +34,43 @@
overalljails = true;
};
tailscale.enable = true;
openssh.enable = true;
openssh = {
enable = true;
ports = [
2022
];
settings = {
PasswordAuthentication = false;
PermitRootLogin = "prohibit-password";
PermitEmptyPasswords = false;
UseDns = false;
KbdInteractiveAuthentication = false;
X11Forwarding = false;
AllowTcpForwarding = false;
AllowAgentForwarding = false;
};
hostKeys = [
{
path = "/etc/ssh/ssh_host_ed25519_key";
type = "ed25519";
}
];
};
};
networking = {
domain = "";
hostId = "81238132";
hostName = "iofq-oracle-x840";
hostName = "oracle1";
firewall = {
enable = true;
allowedTCPPorts = [
22
2022
80
443
];
logRefusedConnections = true;
};
};
users.users.root.openssh.authorizedKeys.keys = [
''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDcL53Gdrj5V9YDwKlCBIcgqiS+zHtOQpJlnOHTevJCJ e@t14''

56
nixos/oracle/forgejo.nix Normal file
View file

@ -0,0 +1,56 @@
{ config, ... }:
let
cfg = config.services.forgejo;
srv = cfg.settings.server;
in
{
sops = {
secrets = {
"env" = {
sopsFile = ../../secrets/cf-acme.yaml;
};
};
};
security.acme = {
acceptTerms = true;
defaults = {
email = "acme@10110110.xyz";
dnsProvider = "cloudflare";
environmentFile = config.sops.secrets."env".path;
};
};
services.nginx = {
enable = true;
virtualHosts.${cfg.settings.server.DOMAIN} = {
forceSSL = true;
enableACME = true;
acmeRoot = null; # use DNS
locations."/" = {
recommendedProxySettings = true;
proxyPass = "http://localhost:${toString srv.HTTP_PORT}";
extraConfig = ''
client_max_body_size 512M;
'';
};
};
};
services.forgejo = {
enable = true;
database.type = "sqlite3";
dump.enable = true;
settings = {
server = {
DOMAIN = "git.10110110.xyz";
# You need to specify this to remove the port from URLs in the web UI.
ROOT_URL = "https://${srv.DOMAIN}/";
HTTP_PORT = 3000;
};
service.DISABLE_REGISTRATION = true;
session.COOKIE_SECURE = true;
actions = {
ENABLED = true;
DEFAULT_ACTIONS_URL = "github";
};
};
};
}