feat(home-server): update hardware & boot configuration

To commodate switch to Tow-Boot & new partitioning using
scripts/setup-partitions.
This commit is contained in:
Felix Schröter 2022-05-15 15:45:00 +02:00
parent e3fbe28103
commit d979a126ab
Signed by: felschr
GPG key ID: 671E39E6744C807D
2 changed files with 35 additions and 33 deletions

View file

@ -1,38 +1,46 @@
{ config, lib, pkgs, modulesPath, ... }:
{
boot.initrd.availableKernelModules = [ "usbhid" ];
boot.initrd.availableKernelModules = [ "xhci_pci" "usbhid" "usb_storage" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
boot.initrd.luks.devices."enc-media".device =
"/dev/disk/by-uuid/47158a41-995a-45d5-b7e1-1dc6e1868be7";
fileSystems."/boot" = {
device = "/dev/disk/by-label/NIXOS_BOOT";
fsType = "vfat";
};
fileSystems."/" = {
device = "/dev/disk/by-label/NIXOS_SD";
fsType = "ext4";
};
fileSystems."/media" = {
device = "/dev/disk/by-uuid/2441d724-7f8e-4bbb-a50f-9074f3d0d3f1";
device = "/dev/disk/by-uuid/7bb1e67d-8c6f-4ace-b8e7-b09cdfd82cab";
fsType = "btrfs";
options = [ "subvol=@" "compress-force=zstd" "noatime" ];
};
fileSystems."/media/.snapshots" = {
device = "/dev/disk/by-uuid/2441d724-7f8e-4bbb-a50f-9074f3d0d3f1";
boot.initrd.luks.devices."enc".device =
"/dev/disk/by-uuid/d163376b-a038-4196-8ef5-7c7fb5508f0c";
fileSystems."/home" = {
device = "/dev/disk/by-uuid/7bb1e67d-8c6f-4ace-b8e7-b09cdfd82cab";
fsType = "btrfs";
options = [ "subvol=@home" "compress-force=zstd" "noatime" ];
};
fileSystems."/.swap" = {
device = "/dev/disk/by-uuid/7bb1e67d-8c6f-4ace-b8e7-b09cdfd82cab";
fsType = "btrfs";
options = [ "subvol=@swap" "nodatacow" "noatime" ];
neededForBoot = true;
};
fileSystems."/.snapshots" = {
device = "/dev/disk/by-uuid/7bb1e67d-8c6f-4ace-b8e7-b09cdfd82cab";
fsType = "btrfs";
options = [ "subvol=@snapshots" "compress-force=zstd" "noatime" ];
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/9ECA-C9A7";
fsType = "vfat";
};
swapDevices = [{
device = "/swapfile";
device = "/.swap/swapfile";
size = 4096;
}];

View file

@ -37,19 +37,15 @@ in with builtins; {
nixpkgs.config.allowUnfree = true;
# rpi4 base config
boot.loader.systemd-boot.enable = true;
boot.loader.generic-extlinux-compatible.enable = false;
boot.loader.raspberryPi.enable = true;
boot.loader.raspberryPi.version = 4;
# boot.loader.raspberryPi.uboot.enable = true;
boot.loader.raspberryPi.firmwareConfig = ''
gpu_mem=320
hdmi_group=1
hdmi_mode=97
hdmi_enable_4kp60=1
disable_overscan=1
'';
boot.kernelParams = [ "console=ttyAMA0,115200" "console=tty1" ];
# boot.loader.efi.canTouchEfiVariables = true;
boot.tmpOnTmpfs = true;
# rpi4 base config
boot.kernelPackages = pkgs.linuxPackages_rpi4;
boot.kernelParams =
[ "8250.nr_uarts=1" "console=ttyAMA0,115200" "console=tty1" "cma=128" ];
# improve memory performance
zramSwap.enable = true;
@ -109,9 +105,7 @@ in with builtins; {
enable = true;
ssh = {
enable = true;
# requires support for initrd secrets (might work w/ uboot when it's supported)
# hostKeys = map (f: f.path) hostKeys;
hostKeys = [ ./host_key ];
hostKeys = map (f: f.path) hostKeys;
authorizedKeys = config.users.users.felschr.openssh.authorizedKeys.keys;
};
};