I started playing around with Nix 2-3 weeks ago. I’ve been able to get it up and running fine on a virtual box vm . I’ve managed to install few packages and make some config changes as well.
Then, I tried flakes as that’s what every nix user recommends. And I was able migrate to it successfully.
Issue
Now I want to have a more “permanent” vm and so I setup a vm on Proxmox. I followed this repo GitHub - mitchellh/nixos-config: My NixOS configurations. as guideline to structure my nix config. (i.e. having a machines folder for each machine and so and so). The base NixOS installation goes through fine but I’m just not able to build the flake. This is the error I got
root@nixos:/nix-config]# nixos-rebuild switch --flake .#vm-intel
building the system configuration...
error: secret key is corrupt
I have no clue which secret it’s referring to. The “only” change I made was a bit of refactoring.
nix store verify throws this error but I also see this error on my VirtualBox VM and there the flake builds with no problem. So I’m not really sure if this is an issue.
[root@nixos:/nix-config]# nix store verify
error: flake 'path:/nix-config' does not provide attribute 'packages.x86_64-linux.default' or 'defaultPackage.x86_64-linux'
How I’ve structured my new configs
The hardware-configuration.nix file is coming from the new proxmox vm installation. But the flake.nixflake.lock and nix configuration file (nixos-config/machines/vm-intel.nix ) is coming from my previous installation in VirtualBox.
Maybe this mismatch is causing the issue … I’m not sure.
Thanks. Interesting that you were able to build it!
fails with the same error on build as well
[root@nixos:/nix-config]# nixos-rebuild build --flake .#vm-intel
building the system configuration...
error: secret key is corrupt
removing the lock file also didn’t help
[root@nixos:/nix-config]# nixos-rebuild build --flake .#vm-intel
building the system configuration...
warning: creating lock file '/nix-config/flake.lock'
error: secret key is corrupt
I had seen this issue before. I doubt that’s a similar issue to mine though. Specially since you were able to build my config.