···5656 # Use latest kernel.
5757 boot.kernelPackages = pkgs.linuxPackages_latest;
58585959+ # portable setup
6060+ boot.initrd.kernelModules = [ "usb_storage" ];
6161+ boot.initrd.preDeviceCommands = ''
6262+ check_root_device() {
6363+ ROOT_UUID="09170382-8b7e-47cc-8fde-d9035039b785"
6464+6565+ # 'test -e' checks if the file/device node exists
6666+ if test -e "/dev/disk/by-uuid/$ROOT_UUID"; then
6767+ return 0 # Success
6868+ else
6969+ return 1 # Failure
7070+ fi
7171+ }
7272+7373+ found() {
7474+ echo "Device found, continuing boot..."
7575+ exit 0
7676+ }
7777+7878+ if ! check_root_device; then
7979+ echo "Root device not found, retrying in 5 seconds..."
8080+ sleep 5
8181+ else
8282+ found
8383+ fi
8484+8585+ if ! check_root_device; then
8686+ echo "Root device not found, retrying in 10 seconds..."
8787+ sleep 10
8888+ else
8989+ found
9090+ fi
9191+9292+ if ! check_root_device; then
9393+ echo "Root device not found, retrying for last time in 20 seconds..."
9494+ sleep 20
9595+ else
9696+ found
9797+ fi
9898+9999+100100+ if ! check_root_device; then
101101+ echo "WARNING: Boot device not found, proceeding with caution."
102102+ else
103103+ found
104104+ fi
105105+ '';
106106+59107 networking = {
60108 hostName = "stellapent-cier";
61109 hosts = hostsFile;
···143191 # Some programs need SUID wrappers, can be configured further or are
144192 # started in user sessions.
145193 programs.mtr.enable = true;
146146-147147- system.nixos.tags = [
148148- "laptop"
149149- "homelab"
150150- ];
151194}