From 0c6fe348d8bcceb38507e953f7927e44ec9fcfad Mon Sep 17 00:00:00 2001 From: Matthieu Morin Date: Sun, 9 Jun 2024 19:30:54 +0000 Subject: [PATCH] fixes - systemd --- systems/jeroboam/default.nix | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/systems/jeroboam/default.nix b/systems/jeroboam/default.nix index 4cb595a..432be09 100644 --- a/systems/jeroboam/default.nix +++ b/systems/jeroboam/default.nix @@ -27,7 +27,8 @@ in { { _module.args = { disk = "/dev/vda"; - withSwap = false; + withSwap = true; + swapSize = "16"; }; } ] @@ -88,12 +89,14 @@ in { initrd = { kernelModules = ["uas" "usbcore" "usb_storage" "vfat" "nls_cp437" "nls_iso8859_1"]; # Mount USB key before trying to decrypt root filesystem - postDeviceCommands = pkgs.lib.mkBefore '' - mkdir -m 0755 -p /key - sleep 2 # To make sure the usb key has been loaded - mount -n -t vfat -o ro `findfs UUID=${PRIMARYUSBID}` /key || mount -n -t vfat -o ro `findfs UUID=${BACKUPUSBID}` /key - ''; + # postDeviceCommands = pkgs.lib.mkBefore '' + # mkdir -m 0755 -p /key + # sleep 2 # To make sure the usb key has been loaded + # mount -n -t vfat -o ro `findfs UUID=${PRIMARYUSBID}` /key || mount -n -t vfat -o ro `findfs UUID=${BACKUPUSBID}` /key + # ''; + systemd.enable = true; # tpm2 unlock requires systemd initrd + luks.devices."crypted" = { bypassWorkqueues = true; device = "/dev/nvme0n1p2"; @@ -108,17 +111,20 @@ in { # and copy the long string into the spot below. keyFile = "/key/hdd.key"; - # Use this if you want to fallback to the encryption password when the drive can't be found. HIGHLY RECCOMENDED!!!! - fallbackToPassword = true; + # Use this if you want to fallback to the encryption password when the drive can't be found. HIGHLY RECCOMENDED!!!! + #~~~~~ Actually it doesn't work as it is implied by systemd stage 1... + # fallbackToPassword = true; + }; }; - resumeDevice = config.fileSystems."/swap".device; + resumeDevice = "/dev/nvme0n1"; # should be pointing to part. where swap resides kernelParams = [ # hibernation "resume_offset=533760" ]; }; + swapDevices = [ { device = "/swap"; size=16*1024; } ]; # ================ HYPRLAND =================== # environment.sessionVariables = {