treewide: format files

Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
This commit is contained in:
2025-06-29 19:49:39 +05:30
parent 404f35c0b9
commit a9d4f6de5a
62 changed files with 953 additions and 511 deletions

View File

@@ -3,9 +3,19 @@
boot = {
kernel.sysctl."net.ipv4.ip_forward" = 1;
initrd.kernelModules = [ "bochs" ];
initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" ];
initrd.availableKernelModules = [
"ata_piix"
"uhci_hcd"
"virtio_pci"
"virtio_scsi"
];
kernelModules = [ "kvm-amd" ];
kernelParams = [ "console=ttyS0" "console=tty1" "nvme.shutdown_timeout=10" "libiscsi.debug_libiscsi_eh=1" ];
kernelParams = [
"console=ttyS0"
"console=tty1"
"nvme.shutdown_timeout=10"
"libiscsi.debug_libiscsi_eh=1"
];
loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;

View File

@@ -1,4 +1,9 @@
{ config, pkgs, conf, ... }:
{
config,
pkgs,
conf,
...
}:
{
imports = [
./networking.nix

View File

@@ -1,16 +1,20 @@
{ config, lib, pkgs, modulesPath, ... }:
{
config,
lib,
pkgs,
modulesPath,
...
}:
{
imports =
[
(modulesPath + "/profiles/qemu-guest.nix")
];
imports = [
(modulesPath + "/profiles/qemu-guest.nix")
];
fileSystems."/" =
{
device = "/dev/disk/by-uuid/d91adce2-9059-4a8a-86e7-dee6ecc85b2b";
fsType = "ext4";
};
fileSystems."/" = {
device = "/dev/disk/by-uuid/d91adce2-9059-4a8a-86e7-dee6ecc85b2b";
fsType = "ext4";
};
swapDevices = [
{

View File

@@ -1,7 +1,15 @@
{ config, pkgs, conf, network, ... }:
{
config,
pkgs,
conf,
network,
...
}:
{
mailserver =
let domain = conf.network.addresses.domain.natto; in
let
domain = conf.network.addresses.domain.natto;
in
rec {
enable = true;
fqdn = "mail.${domain}";

View File

@@ -1,27 +1,43 @@
{ lib, config, conf, pkgs, ... }:
{
lib,
config,
conf,
pkgs,
...
}:
{
networking = {
useDHCP = false;
hostName = "remilia";
firewall =
{
interfaces = {
ens3 = {
allowedTCPPorts = [ 80 81 443 444 993 465 143 25 22 22001 22002 4444 ]
++ (map (x: x.sourcePort) config.networking.nat.forwardPorts);
allowedUDPPorts = [ 17840 ];
};
firewall = {
interfaces = {
ens3 = {
allowedTCPPorts = [
80
81
443
444
993
465
143
25
22
22001
22002
4444
] ++ (map (x: x.sourcePort) config.networking.nat.forwardPorts);
allowedUDPPorts = [ 17840 ];
};
extraCommands = lib.concatMapStringsSep "\n"
(x:
let
t = lib.splitString ":" x.destination;
in
with lib;
"iptables -t nat -A POSTROUTING -d ${head t} -p tcp -m tcp --dport ${last t} -j MASQUERADE"
)
config.networking.nat.forwardPorts;
};
extraCommands = lib.concatMapStringsSep "\n" (
x:
let
t = lib.splitString ":" x.destination;
in
with lib;
"iptables -t nat -A POSTROUTING -d ${head t} -p tcp -m tcp --dport ${last t} -j MASQUERADE"
) config.networking.nat.forwardPorts;
};
interfaces = {
ens3 = {
useDHCP = true;

View File

@@ -1,4 +1,10 @@
{ config, pkgs, lib, conf, ... }:
{
config,
pkgs,
lib,
conf,
...
}:
let
domain = conf.network.addresses.domain.natto;
in
@@ -8,7 +14,10 @@ in
openssh = {
enable = true;
settings.PermitRootLogin = "yes";
ports = [ 22 22002 ];
ports = [
22
22002
];
};
nginx = {
enable = true;
@@ -24,20 +33,29 @@ in
'';
virtualHosts =
let
genericHttpRProxy = { addr, ssl ? true, conf ? "" }: {
enableACME = ssl;
# addSSL = ssl;
forceSSL = ssl;
locations."/" = {
proxyPass = toString addr;
extraConfig = ''
expires $expires;
proxy_set_header Host $host;
'' + conf;
genericHttpRProxy =
{
addr,
ssl ? true,
conf ? "",
}:
{
enableACME = ssl;
# addSSL = ssl;
forceSSL = ssl;
locations."/" = {
proxyPass = toString addr;
extraConfig =
''
expires $expires;
proxy_set_header Host $host;
''
+ conf;
};
};
};
in
with conf.network.addresses.wireguard.ips; {
with conf.network.addresses.wireguard.ips;
{
"${domain}" = {
addSSL = true;
enableACME = true;
@@ -51,7 +69,8 @@ in
# "consul.${domain}" = genericHttpRProxy { addr = "http://${marisa}:8500"; };
"f.${domain}" = genericHttpRProxy { addr = "http://${marisa}:8000"; };
"radio.${domain}" = genericHttpRProxy { addr = "http://${satori}:8001"; };
/* "radio.${domain}" = {
/*
"radio.${domain}" = {
addSSL = true;
enableACME = true;
locations."/" = {
@@ -62,13 +81,15 @@ in
'';
};
locations."= /".return = "301 /radio";
};*/
};
*/
"git.${domain}" = genericHttpRProxy {
addr = "http://${marisa}:5001";
conf = "client_max_body_size 64M;";
};
/*"nomad.${domain}" = genericHttpRProxy {
/*
"nomad.${domain}" = genericHttpRProxy {
addr = "http://${marisa}:4646";
conf = ''
proxy_buffering off;
@@ -80,4 +101,3 @@ in
};
};
}