2023-10-31 05:42:06 +08:00
|
|
|
{
|
2024-08-08 09:02:42 +08:00
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
hostname = config.networking.hostName;
|
|
|
|
in {
|
2024-01-21 21:03:57 +08:00
|
|
|
imports = [
|
|
|
|
../common/optional/ephemeral-btrfs.nix
|
|
|
|
];
|
|
|
|
|
|
|
|
boot = {
|
|
|
|
initrd = {
|
2024-08-08 09:02:42 +08:00
|
|
|
availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod"];
|
|
|
|
kernelModules = ["kvm-intel"];
|
2023-10-31 05:42:06 +08:00
|
|
|
};
|
2024-01-21 21:03:57 +08:00
|
|
|
loader = {
|
|
|
|
systemd-boot.enable = true;
|
|
|
|
efi = {
|
|
|
|
canTouchEfiVariables = true;
|
|
|
|
efiSysMountPoint = "/boot";
|
|
|
|
};
|
2023-10-31 05:42:06 +08:00
|
|
|
};
|
2024-01-21 21:03:57 +08:00
|
|
|
};
|
2023-10-31 05:42:06 +08:00
|
|
|
|
2024-08-08 09:02:42 +08:00
|
|
|
fileSystems."/boot" = {
|
2024-01-21 21:03:57 +08:00
|
|
|
device = "/dev/disk/by-label/ESP";
|
|
|
|
fsType = "vfat";
|
|
|
|
};
|
2023-10-31 05:42:06 +08:00
|
|
|
|
2024-08-08 09:02:42 +08:00
|
|
|
fileSystems."/srv/multimedia" = {
|
2024-01-22 20:01:52 +08:00
|
|
|
device = "/dev/disk/by-label/multimedia";
|
2024-01-21 21:03:57 +08:00
|
|
|
fsType = "ext4";
|
|
|
|
};
|
2023-12-19 09:21:33 +08:00
|
|
|
|
2024-01-22 20:01:52 +08:00
|
|
|
fileSystems."/srv/containers" = {
|
2024-06-03 21:13:38 +08:00
|
|
|
device = "/dev/disk/by-label/${hostname}";
|
2024-01-22 20:01:52 +08:00
|
|
|
fsType = "btrfs";
|
2024-08-08 09:02:42 +08:00
|
|
|
options = ["subvol=containers" "compress=zstd"];
|
2024-01-22 20:01:52 +08:00
|
|
|
};
|
|
|
|
|
2024-06-03 21:13:38 +08:00
|
|
|
fileSystems."/srv/services" = {
|
|
|
|
device = "/dev/disk/by-label/${hostname}";
|
|
|
|
fsType = "btrfs";
|
2024-08-08 09:02:42 +08:00
|
|
|
options = ["subvol=services" "compress=zstd"];
|
2024-06-03 21:13:38 +08:00
|
|
|
};
|
|
|
|
|
2024-06-03 21:10:23 +08:00
|
|
|
fileSystems."/srv/shares" = {
|
|
|
|
device = "/dev/disk/by-label/data";
|
|
|
|
fsType = "btrfs";
|
2024-08-08 09:02:42 +08:00
|
|
|
options = ["subvol=shares" "compress=zstd"];
|
2024-06-03 21:10:23 +08:00
|
|
|
};
|
|
|
|
|
2024-01-22 20:01:52 +08:00
|
|
|
fileSystems."/srv/backup" = {
|
|
|
|
device = "/dev/disk/by-label/data";
|
|
|
|
fsType = "btrfs";
|
2024-08-08 09:02:42 +08:00
|
|
|
options = ["subvol=backup" "compress=zstd"];
|
2024-01-21 21:03:57 +08:00
|
|
|
};
|
2023-10-31 05:42:06 +08:00
|
|
|
|
2024-08-08 09:02:42 +08:00
|
|
|
swapDevices = [
|
|
|
|
{
|
|
|
|
device = "/swap/swapfile";
|
|
|
|
size = 16 * 1024;
|
2024-01-21 21:03:57 +08:00
|
|
|
}
|
|
|
|
];
|
2023-10-31 05:42:06 +08:00
|
|
|
|
|
|
|
networking.useDHCP = lib.mkDefault true;
|
|
|
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
|
|
|
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
|
|
|
|
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
|
|
|
}
|