[solved] Device is not a valid LUKS device

Hello, some days ago I tried to install luks on my hard drive, but instead of reading like I should’ve I just copied and pasted the code on my /etc/configuration.nix( yes i know how dumb I am). Now, around two days later I turned off my computer and when I turned it back on it’s asking the passphrase for /dev/disk/by-label/nixos(which I did not set) and when I try to enter any password it prints:

Verifying passphrase for /dev/disk/by-label/nixos…Device /dev/disk/by-label/nixos is not a valid LUKS device.

I tried to search for a default password or use my root password and neither worked. I’m dumb I know, but can anyone please help me?

If all you did was put the code in configuration.nix, then your drive is not actually luks encrypted, but nixos thinks it is. So it’s trying to unlock a drive that isn’t locked, and obviously failing. You need to boot an older generation (thank NixOS for making this possible :P) that doesn’t think your drive is encrypted, because it’s not.

damm I really am very stupid. I tried to go to an older generation but must’ve went to one which was already encrypted. Anyhow thanks a lot man and thanks to nixos too :slight_smile: