nixos_config/nixos/hosts/blogbox/configuration.nix

143 lines
3.1 KiB
Nix
Raw Normal View History

2026-05-29 19:30:07 +02:00
{ lib, pkgs, modulesPath, ... }:
{
imports = [
"${modulesPath}/virtualisation/oci-image.nix"
../../modules/services/blogbox.nix
2026-05-29 19:30:07 +02:00
../../modules/services/cloud-init.nix
../../modules/services/oci-authorized-keys.nix
];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
2026-05-30 16:54:22 +02:00
oci.efi = lib.mkForce false;
virtualisation.diskSize = lib.mkForce (8 * 1024);
2026-05-29 19:30:07 +02:00
networking = {
hostName = "blogbox";
networkmanager.enable = lib.mkForce false;
firewall.allowedTCPPorts = [
22
];
};
boot = {
2026-05-30 09:38:41 +02:00
initrd.availableKernelModules = [
"virtio_pci"
"virtio_blk"
"virtio_scsi"
"virtio_net"
"xhci_pci"
];
2026-05-30 16:54:22 +02:00
kernelParams = lib.mkForce [
"nvme.shutdown_timeout=10"
"nvme_core.shutdown_timeout=10"
"libiscsi.debug_libiscsi_eh=1"
"crash_kexec_post_notifiers"
"console=tty1"
"console=ttyS0,115200n8"
"earlyprintk=serial,ttyS0,115200"
"loglevel=7"
"systemd.log_target=console"
"systemd.journald.forward_to_console=1"
];
kernelPackages = lib.mkForce pkgs.linuxPackages;
loader.grub.configurationLimit = lib.mkForce 3;
2026-05-29 19:30:07 +02:00
loader.systemd-boot.configurationLimit = lib.mkForce 3;
};
nix = {
settings = {
2026-05-30 16:54:22 +02:00
cores = lib.mkForce 1;
max-jobs = lib.mkForce 1;
min-free = lib.mkForce (256 * 1024 * 1024);
max-free = lib.mkForce (1024 * 1024 * 1024);
2026-05-29 19:30:07 +02:00
};
gc = {
dates = lib.mkForce "daily";
options = lib.mkForce "--delete-older-than 3d";
};
};
2026-05-30 15:18:13 +02:00
virtualisation = {
2026-05-30 16:54:22 +02:00
containers.enable = lib.mkForce false;
2026-05-30 15:18:13 +02:00
docker.enable = lib.mkForce false;
2026-05-30 16:54:22 +02:00
libvirtd = {
enable = lib.mkForce false;
qemu.swtpm.enable = lib.mkForce false;
2026-05-30 15:18:13 +02:00
};
2026-05-30 16:54:22 +02:00
podman.enable = lib.mkForce false;
2026-05-30 15:18:13 +02:00
};
users.users.alisceon.extraGroups = [ "systemd-journal" ];
alisceon = {
blogbox.enable = true;
2026-05-30 16:54:22 +02:00
cloud-init.enable = true;
2026-05-30 15:18:13 +02:00
ociAuthorizedKeys.enable = true;
2026-05-30 09:38:41 +02:00
};
2026-05-29 19:30:07 +02:00
security = {
acme = {
acceptTerms = true;
defaults.email = "acme@alisceon.com";
};
sudo-rs.wheelNeedsPassword = false;
};
2026-05-30 15:18:13 +02:00
services.openssh.settings = {
2026-05-30 16:54:22 +02:00
KbdInteractiveAuthentication = false;
2026-05-30 15:18:13 +02:00
PasswordAuthentication = false;
2026-05-30 16:54:22 +02:00
PermitRootLogin = lib.mkForce "no";
2026-05-30 15:18:13 +02:00
};
2026-05-30 16:54:22 +02:00
services.journald.extraConfig = ''
SystemMaxUse=64M
RuntimeMaxUse=32M
'';
2026-05-30 09:38:41 +02:00
2026-05-30 16:54:22 +02:00
system.autoUpgrade = {
enable = lib.mkForce true;
persistent = lib.mkForce true;
2026-05-30 09:38:41 +02:00
};
2026-05-30 16:54:22 +02:00
systemd = {
services = {
dev-flake-garbage-collect.enable = lib.mkForce false;
nixos-upgrade.serviceConfig = {
IOSchedulingClass = "idle";
MemoryHigh = "512M";
MemoryMax = "900M";
Nice = 15;
OOMPolicy = "stop";
};
2026-05-30 09:38:41 +02:00
};
2026-05-30 16:54:22 +02:00
timers.dev-flake-garbage-collect.enable = lib.mkForce false;
2026-05-29 19:30:07 +02:00
};
2026-05-30 16:54:22 +02:00
services.cloud-init.settings.disable_root = true;
2026-05-30 15:18:13 +02:00
environment.systemPackages = with pkgs; [
curl
git
htop
jq
vim
wget
];
2026-05-29 19:30:07 +02:00
2026-05-30 16:54:22 +02:00
swapDevices = [
{
device = "/swapfile";
size = 4096;
}
];
zramSwap = {
enable = true;
memoryPercent = 75;
};
2026-05-29 19:30:07 +02:00
system.stateVersion = lib.mkForce "25.11";
}