nix-config/nixos/viridian/hardware-configuration.nix
jasmine b0bfb37d3c
refactor(viridian): migrate service data to dedicated BTRFS subvolumes
Migrate from path-based persistence (/persist/var/lib/*) to dedicated
BTRFS subvolumes for better data isolation and snapshot capabilities.

- Move valuable user-facing services to /srv/* with srv-* subvolumes:
  - forgejo: git repositories and database
  - opengist: paste data
  - minecraft: game world data
  - lighttpd: static web content
  - containers: OCI container volumes

- Update home directory to use hm-sajenim subvolume on viridian disk
- Remove jupyterhub service (no longer in use)
- Update borgbackup paths to match new service locations
- Follow upstream service defaults where possible for maintainability

Services kept on /persist (disposable state):
- traefik, crowdsec, murmur
2025-10-06 13:07:46 +08:00

66 lines
1.5 KiB
Nix

{
config,
lib,
pkgs,
...
}: {
imports = [
# Our ephemeral system. Wipe root on reboot.
../common/optional/ephemeral-btrfs.nix
];
# Boot configuration
boot = {
# Initial ramdisk
initrd = {
# The modules listed here are available in the initrd, but are only loaded on demand.
availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod"];
# List of modules that are always loaded by the initrd.
kernelModules = ["kvm-intel"];
};
# Runtime parameters of the Linux kernel
kernel.sysctl = {
"net.ipv4.ip_unprivileged_port_start" = 0;
};
# Our boot loader configuration
loader = {
efi = {
efiSysMountPoint = "/boot";
canTouchEfiVariables = true;
};
systemd-boot.enable = true;
};
};
# Hardware configuration
hardware.graphics = {
enable = true;
extraPackages = with pkgs; [
intel-media-driver
vaapiIntel
vaapiVdpau
libvdpau-va-gl
intel-compute-runtime
];
};
# Setup our filesystems
fileSystems."/boot" = {
device = "/dev/disk/by-label/ESP";
fsType = "vfat";
};
swapDevices = [
{
device = "/swap/swapfile";
size = 16 * 1024;
}
];
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;
}