Clean up config & add comments.

This commit is contained in:
Fern Garden 2025-07-16 18:46:12 +08:00
parent b504700e61
commit c2fc35e12d
18 changed files with 162 additions and 114 deletions

24
suites/server/default.nix Normal file
View file

@ -0,0 +1,24 @@
{
imports = [../.]; # Common config.
# Passwordless sudo.
security.sudo.wheelNeedsPassword = false;
# Enable sshd.
services.openssh = {
enable = true;
settings = {
PermitRootLogin = "no";
PasswordAuthentication = false;
KbdInteractiveAuthentication = false;
};
};
# Add authorized ssh pubkeys.
users.users.fern = {
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIETPyuxUVEmYyEW6PVC6BXqkhULHd/RvMm8fMbYhjTMV fern@muskduck"
"sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIMoJvPcUJDVVzO4dHROCFNlgJdDZSP5xyPx2s40zcx5QAAAABHNzaDo= YubiKey5NFC"
];
};
}

View file

@ -0,0 +1,9 @@
{
# Add user to docker group.
users.users.fern = {
extraGroups = ["docker"];
};
# Enable docker.
virtualisation.docker.enable = true;
}

View file

@ -0,0 +1,6 @@
{modulesPath, ...}: {
imports = [
(modulesPath + "/virtualisation/proxmox-lxc.nix")
../. # Server config.
];
}

View file

@ -0,0 +1,34 @@
{
modulesPath,
lib,
...
}:
with lib; {
imports = [
(modulesPath + "/profiles/qemu-guest.nix")
../. # Server config.
];
# Load kernel modules.
boot.initrd.availableKernelModules = [
"ata_piix"
"uhci_hcd"
"virtio_pci"
"virtio_scsi"
"sd_mod"
];
boot.kernelModules = ["kvm-intel"];
# Enable DHCP.
networking.useDHCP = mkDefault true;
# Configure the bootloader.
boot.loader.grub = {
enable = true;
device = "/dev/sda";
};
# Enable QEMU guest agent
services.qemuGuest.enable = true;
}