You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using sops-nix as a home-manager module on NixOS in WSL. The sops-nix.service fails during normal activation and nixos-rebuild with the following error message:
Nov 29 09:51:07 BL8W6G3 v95chg2b7d57pc7f08q7pym1h3bk3f8l-sops-nix-user[250104]: /nix/store/kvgassgqvfx8lqk12ramqdks59f3s3zc-sops-install-secrets-0.0.1/bin/sops-install-secrets: cannot update secrets symlink: rename /home/nialov/.config/sops-nix/.secrets3251914507/tmp.symlink /home/nialov/.config/sops-nix/secrets: file exists
Nov 29 09:51:07 BL8W6G3 systemd[2135]: sops-nix.service: Main process exited, code=exited, status=1/FAILURE
Nov 29 09:51:07 BL8W6G3 systemd[2135]: sops-nix.service: Failed with result 'exit-code'.
Nov 29 09:51:07 BL8W6G3 systemd[2135]: Failed to start sops-nix activation.
If I check the secrets directory after a failed activation, it has been created but has only one secret:
➜ ls /home/nialov/.config/sops-nix/secrets/
dragonsden_openai-api-key
So it seems the service tries to recreate the directory even after one secret has already been decrypted/symlinked?
Solution
While I was writing this issue I thought to check the specific secret that is created. I was configuring its name manually:
and the secrets were created (or rm -r the secrets dir myself). However, when I configured the name again, and used nixos-rebuild, I had no errors. Except until I rebooted. Then I had to disable the naming again to make the service succeed. So the naming seems to cause a problem that I believe is independent of my environment (WSL can cause many problems, but maybe not this one?), i.e. an error within sops-nix.
System info
I am using this on WSL where there is a known problem of the systemd user service not starting (nix-community/NixOS-WSL#375).
Problem
I am using
sops-nix
as ahome-manager
module on NixOS in WSL. Thesops-nix.service
fails during normal activation andnixos-rebuild
with the following error message:If I check the
secrets
directory after a failed activation, it has been created but has only one secret:So it seems the service tries to recreate the directory even after one secret has already been decrypted/symlinked?
Solution
While I was writing this issue I thought to check the specific secret that is created. I was configuring its name manually:
Removing the manual naming made the service work again, almost. I had to add:
and the secrets were created (or
rm -r
the secrets dir myself). However, when I configured the name again, and usednixos-rebuild
, I had no errors. Except until I rebooted. Then I had to disable the naming again to make the service succeed. So the naming seems to cause a problem that I believe is independent of my environment (WSL can cause many problems, but maybe not this one?), i.e. an error withinsops-nix
.System info
I am using this on WSL where there is a known problem of the systemd user service not starting (nix-community/NixOS-WSL#375).
The text was updated successfully, but these errors were encountered: