80 lines
2 KiB
Nix
80 lines
2 KiB
Nix
# SPDX-FileCopyrightText: 2024 Simon Bruder <simon@sbruder.de>
|
|
#
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
{ modulesPath, pkgs, ... }:
|
|
|
|
{
|
|
imports = [
|
|
(modulesPath + "/installer/scan/not-detected.nix")
|
|
];
|
|
|
|
boot = {
|
|
swraid.enable = true;
|
|
kernelModules = [ "kvm-amd" "nct6775" ];
|
|
kernelParams = [ "ip=dhcp" ];
|
|
loader = {
|
|
grub = {
|
|
devices = [ "/dev/nvme0n1" "/dev/nvme1n1" ];
|
|
};
|
|
};
|
|
initrd = {
|
|
availableKernelModules = [ "aesni_intel" "ahci" "igb" "nvme" ];
|
|
kernelModules = [ "dm-snapshot" ];
|
|
network.enable = true; # remote unlocking
|
|
luks.devices = {
|
|
koyomi-pv = {
|
|
name = "koyomi-pv";
|
|
device = "/dev/disk/by-uuid/4907ad59-e6cf-40ed-a0ff-3dc09c0c7a50";
|
|
preLVM = true;
|
|
allowDiscards = true;
|
|
};
|
|
};
|
|
|
|
# FIXME XXX HACK
|
|
# This is required to have the md device available under /dev/disk/by-uuid.
|
|
# Both commands are run as part of the regular stage-1 init script,
|
|
# but for some reason, they need to be run twice.
|
|
preLVMCommands = ''
|
|
udevadm trigger
|
|
udevadm settle
|
|
'';
|
|
};
|
|
};
|
|
|
|
fileSystems = {
|
|
"/" = {
|
|
device = "/dev/disk/by-uuid/4b4efa64-e571-4937-bb1c-7608e9d7630d";
|
|
fsType = "btrfs";
|
|
options = [ "discard=async" "noatime" "compress=zstd" ];
|
|
};
|
|
|
|
"/boot" = {
|
|
device = "/dev/disk/by-uuid/83e67d66-ec76-4c9f-8796-1165cdb5362d";
|
|
fsType = "ext2";
|
|
};
|
|
};
|
|
|
|
services.prometheus.exporters.smartctl.devices = [ "/dev/nvme0n1" "/dev/nvme1n1" ];
|
|
|
|
# Not used for boot, but required to make thin LVs work
|
|
services.lvm.boot.thin.enable = true;
|
|
|
|
# TODO Enable periodic RAID scrubbing/checking with mdcheck
|
|
|
|
networking.useDHCP = false;
|
|
networking.usePredictableInterfaceNames = false;
|
|
systemd.network = {
|
|
enable = true;
|
|
networks = {
|
|
eth0 = {
|
|
name = "eth0";
|
|
DHCP = "yes";
|
|
domains = [ "sbruder.de" ];
|
|
address = [ "2a01:4f9:3051:39c6::1/64" ];
|
|
gateway = [ "fe80::1" ];
|
|
};
|
|
};
|
|
};
|
|
}
|