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, ... }: { config, lib, pkgs, modulesPath, ... }:
{ {
boot.initrd.availableKernelModules = [ "usbhid" ]; boot.initrd.availableKernelModules = [ "xhci_pci" "usbhid" "usb_storage" ];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ]; boot.kernelModules = [ ];
boot.extraModulePackages = [ ]; 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."/" = { fileSystems."/" = {
device = "/dev/disk/by-label/NIXOS_SD"; device = "/dev/disk/by-uuid/7bb1e67d-8c6f-4ace-b8e7-b09cdfd82cab";
fsType = "ext4";
};
fileSystems."/media" = {
device = "/dev/disk/by-uuid/2441d724-7f8e-4bbb-a50f-9074f3d0d3f1";
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=@" "compress-force=zstd" "noatime" ]; options = [ "subvol=@" "compress-force=zstd" "noatime" ];
}; };
fileSystems."/media/.snapshots" = { boot.initrd.luks.devices."enc".device =
device = "/dev/disk/by-uuid/2441d724-7f8e-4bbb-a50f-9074f3d0d3f1"; "/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"; fsType = "btrfs";
options = [ "subvol=@snapshots" "compress-force=zstd" "noatime" ]; options = [ "subvol=@snapshots" "compress-force=zstd" "noatime" ];
}; };
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/9ECA-C9A7";
fsType = "vfat";
};
swapDevices = [{ swapDevices = [{
device = "/swapfile"; device = "/.swap/swapfile";
size = 4096; size = 4096;
}]; }];

View file

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