From 4217290c39b62f1843ea139f1ccc05095a1a2e3e Mon Sep 17 00:00:00 2001 From: madmin Date: Sat, 20 Jul 2024 10:20:24 +0200 Subject: [PATCH] fix(jeroboam): define passthru as workaround, clean boot definitions --- systems/jeroboam/default.nix | 82 +++++++++++++++++++++++++++--------- 1 file changed, 61 insertions(+), 21 deletions(-) diff --git a/systems/jeroboam/default.nix b/systems/jeroboam/default.nix index e0a2f57..4b8e4d5 100644 --- a/systems/jeroboam/default.nix +++ b/systems/jeroboam/default.nix @@ -1,5 +1,3 @@ - - ############################################################# # =========================================================== # Rehoboam - LT1 @@ -7,7 +5,7 @@ # =========================================================== ############################################################# -{ inputs, configLib, ... }: +{ inputs, pkgs, lib, configLib, ... }: { imports = [ # ================= Every Host Needs This ==================== # @@ -15,8 +13,8 @@ # ==================== Hardware Modules ====================== # inputs.hardware.nixosModules.common-cpu-amd - inputs.hardware.nixosModules.common-gpu-amd - inputs.hardware.nixosModules.common-pc-ssd + # inputs.hardware.nixosModules.common-gpu-amd + inputs.hardware.nixosModules.common-pc-laptop # ====================== Disk Layout ========================= # inputs.disko.nixosModules.disko @@ -41,10 +39,8 @@ #"systems/common/optional/msmtp.nix" # required for emailing clamav alerts #"systems/common/optional/services/openssh.nix" # allow remote ssh "systems/common/optional/pipewire.nix" # audio - "systems/common/optional/boot/systemd_boot.nix" # systemd boot on "systems/common/optional/boot/loud_boot.nix" # for testing, otherwise quiet_boot.nix - #"systems/common/optional/boot/quiet_boot.nix" # with plymouth pretty custom load sequence - "systems/common/optional/boot/initrd_luks.nix" # luks encryption with pass only + #"systems/common/optional/boot/quiet_boot.nix" # with plymouth pretty custom load sequence # ------------------------ Desktop --------------------------- # #"systems/common/optional/services/greetd.nix" # display manager @@ -86,24 +82,68 @@ }; # TODO Hyprland - #programs.hyprland = { + #programs.hyprland = { #enable = true; #nvidiaPatches = false; #xwayland.enable = true; - #}; + #}; + - hardware = { - # Opengl - opengl.enable = true; + # ============== Systemd Boot ============== # + + boot.loader = { + systemd-boot = { + enable = true; + consoleMode = "max"; + }; + efi.canTouchEfiVariables = true; + }; - # Most wayland compositors need this - nvidia.modesetting.enable = false; - }; + # ============ Initrd Luks ================ # - # Fix to enable VSCode to successfully remote SSH on a client to a NixOS host - # https://nixos.wiki/wiki/Visual_Studio_Code # Remote_SSH - # programs.nix-ld.enable = true; + boot = { + kernelPackages = pkgs.linuxPackages_latest; + supportedFilesystems = [ "btrfs" ]; + initrd = { + kernelModules = [ "uas" "usbcore" "usb_storage" "vfat" "nls_cp437" "nls_iso8859_1" ]; + luks.devices."crypted" = { + bypassWorkqueues = true; + # ~~~> Define this in system configuration <~~~ search by uuid, partuuid, id, or other stable identification ~> lsblk, blkid or ls -l + device = lib.mkDefault "/dev/disk/by-partuuid/5e65cc4c-eb35-4d62-8fcd-387d6a87c067"; + # crypttabExtraOpts = [ "tpm2-device=auto" ]; # tpm2 unlock + preLVM = true; + allowDiscards = true; + + # If using a USB or SD Card : + # keyFileSize = 4096; + # keyFile = "/key/hdd.key"; - # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion - system.stateVersion = "24.05"; + # Use this if you want to fallback to the encryption password when the drive can't be found. HIGHLY RECCOMENDED!!!! + # fallbackToPassword = true; + + }; + }; + resumeDevice = "/dev/nvme0n1"; # should be pointing to disk/dev where swap resides, for some reason my disk does not have uuid + kernelParams = [ + # hibernation + "resume_offset=533760" + ]; + }; + + hardware = { + # Opengl + #opengl.enable = true; + # Most wayland compositors need this + nvidia.modesetting.enable = false; + }; + passthru = { + requiredLv2Packages = {}; + }; + + # Fix to enable VSCode to successfully remote SSH on a client to a NixOS host + # https://nixos.wiki/wiki/Visual_Studio_Code # Remote_SSH + # programs.nix-ld.enable = true; + + # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion + system.stateVersion = "24.05"; }