From ab4f87de72580ed508e38021ce637794f01808d8 Mon Sep 17 00:00:00 2001 From: chaos Date: Sun, 5 May 2024 15:37:37 +0100 Subject: [PATCH] remove plymouth ask for password and instead just hide splash --- flake.lock | 6 ++-- modules/nixos/encryptedDrive.nix | 56 ++++++++++++-------------------- presets/nixos/desktopBase.nix | 2 -- 3 files changed, 23 insertions(+), 41 deletions(-) diff --git a/flake.lock b/flake.lock index f54d112..0f130bb 100644 --- a/flake.lock +++ b/flake.lock @@ -194,11 +194,11 @@ }, "nur": { "locked": { - "lastModified": 1714736743, - "narHash": "sha256-DPXEeLRIHazWyMYVXmhvJlfSAV0aF9nc9y6k4vthx8U=", + "lastModified": 1714825428, + "narHash": "sha256-6U4cppyR0u6sqSSVr3GMrnIXhP2YGR0knfgrUGtr/1Y=", "owner": "nix-community", "repo": "NUR", - "rev": "5f91bfaba4e2a2a2fdcce3b711b76b9aed14cbde", + "rev": "5847f3365c16afafc10c56994beadd4cdc8552ee", "type": "github" }, "original": { diff --git a/modules/nixos/encryptedDrive.nix b/modules/nixos/encryptedDrive.nix index 2c43635..b16ef63 100644 --- a/modules/nixos/encryptedDrive.nix +++ b/modules/nixos/encryptedDrive.nix @@ -52,6 +52,12 @@ in { mkdir -m 0755 -p /keys mkdir -m 0755 -p ${encryptedUSB.mountpoint} + ${ + if config.boot.plymouth.enable + then "${pkgs.plymouth}/bin/plymouth hide-splash" + else "" + } + ${ if cfg.allowPasswordDecrypt then '' @@ -68,45 +74,17 @@ in { while !(test -b ${encryptedUSB.encryptedPath}) && [ "$USE_PASSWORD_FALLBACK" == "false" ] do - ${ - if config.boot.plymouth.enable - then '' - ${pkgs.plymouth}/bin/plymouth display-message --text="Please Plug In USB" - '' - else '' - echo "Please Plug In USB" - '' - } + echo "Please Plug In USB" sleep 1 done - ${ - if config.boot.plymouth.enable - then '' - ${pkgs.plymouth}/bin/plymouth hide-message --text="Please Plug In USB" - - if [ "$USE_PASSWORD_FALLBACK" == "true" ]; then - ${pkgs.plymouth}/bin/plymouth ask-for-password \ - --prompt="Please Enter Password" \ - --command="cryptsetup -T1 open ${driveData.encryptedPath} ${driveData.mapperName}" \ - --number-of-tries=3 - else - ${pkgs.plymouth}/bin/plymouth ask-for-password \ - --prompt="Please Decrypt USB" \ - --command="cryptsetup -T1 open ${encryptedUSB.encryptedPath} ${encryptedUSB.preBootMapperName}" \ - --number-of-tries=3 - fi - '' - else '' - if [ "$USE_PASSWORD_FALLBACK" == "true" ]; then - echo "Please Decrypt Drive" - cryptsetup open ${driveData.encryptedPath} ${driveData.mapperName} - else - echo "Please Decrypt USB" - cryptsetup open ${encryptedUSB.encryptedPath} ${encryptedUSB.preBootMapperName} - fi - '' - } + if [ "$USE_PASSWORD_FALLBACK" == "true" ]; then + echo "Please Decrypt Drive" + cryptsetup open ${driveData.encryptedPath} ${driveData.mapperName} + else + echo "Please Decrypt USB" + cryptsetup open ${encryptedUSB.encryptedPath} ${encryptedUSB.preBootMapperName} + fi if [ "$USE_PASSWORD_FALLBACK" == "false" ]; then mount -n -t ${encryptedUSB.unencryptedFSType} -o ro ${encryptedUSB.preBootMapperPath} ${encryptedUSB.mountpoint} @@ -119,6 +97,12 @@ in { else touch /keys/${config.networking.hostName}.key fi + + ${ + if config.boot.plymouth.enable + then "${pkgs.plymouth}/bin/plymouth show-splash" + else "" + } ''); initrd.luks.devices = { "${driveData.mapperName}" = { diff --git a/presets/nixos/desktopBase.nix b/presets/nixos/desktopBase.nix index ad53b10..cdb75c0 100644 --- a/presets/nixos/desktopBase.nix +++ b/presets/nixos/desktopBase.nix @@ -11,8 +11,6 @@ profiles.mullvad ]; - boot.plymouth.enable = true; - home-manager.users.chaos = { imports = with tree; [ home.gui.base