Error: secret key is corrupt when building flake

I was able to build it.

❯ nixos-rebuild build --flake .#vm-intel
building the system configuration...
warning: updating lock file '/home/will/code/external/nixos-config/flake.lock':
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/c68a9fc85c2cb3a313be6ff40511635544dde8da' (2024-02-15)
  → 'github:nixos/nixpkgs/b7ee09cf5614b02d289cd86fcfa6f24d4e078c2a' (2024-02-26)
warning: Git tree '/home/will/code/external/nixos-config' is dirty

For some reason it updated the lock file.

nix store verify I think is a red herring. I get the same issue on my flake system config.

Do you only get that error when switching?

Perhaps related to: Getting "secret key is corrupt" on most commands · Issue #45339 · NixOS/nixpkgs · GitHub

Perhaps try deleting your lock file and rebuilding.

1 Like