Skip to content

Add a integration where the sudo password can be specified in a sops encrypted file #324

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

weriomat
Copy link
Contributor

@weriomat weriomat commented Jun 5, 2025

As I use sudo on my machines (to elevate the privileges from the "deploy" user) and don't want to manually type the sudo password every time I run a deployment, I implemented a solution where the password is retrieved from a sops encrypted file.
This is especially nice since I use sops-nix to set the password of the user and now can reuse this fact to run the deployment.

In particular, we need to specify sudoFile as well as sudoSecret for a node.
I introduced a NixOS test for this use case as well as provided an example and explained on how sudoSecrets works.
Currently, the only drawback I see with this approach is that SOPS_AGE_KEY_FILE (sops will look for age private keys under $XDG_CONFIG_HOME/sops/age/keys.txt by default) will not be respected by this implementation and therefore forcing users to put the keys under the aforementioned directory (I have not tested that it won't work, but I assume that).

P.S. The flake under example/sops currently points to my fork and should be changed when this gets merged :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant