-
Notifications
You must be signed in to change notification settings - Fork 119
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
how to use agenix.homeManagerModules.default
on Darwin to manage an SSH-key?
#260
Comments
agenix.homeManagerModules.default
on Darwinagenix.homeManagerModules.default
on Darwin to manage an SSH-key?
I managed to fix this by doing the following voodoo, which works, but might not be the greatest solution to ever exist:
I can generalize and contribute (part of) this to home-manager, but I am not sure whether it would be a good fit. |
This On my system it evaluates the same as
I see zero references to I'm sure there has been prior discussion on this. Seems like it should ideally be a directory that does not persist across reboots and obviously needs to be one with user permissions for creating files (which seems to rule out I don't think stuff in |
Hi there! Thanks for this great project! I have been happily using this for a while, and it works great, both for Linux and Darwin.
I have been fighting a while with using the home-manager module on darwin of this project to manage secret files (SSH key in my case) within my home folder, and cannot figure it out (system-wide using nix-darwin works great!).
I have looked at related issues, like
Attempt 1: just using path as 'normal'
By doing the following in home-manager
and this with agenix:
I get the following result:
Usage of env variables is supported in ~/.ssh/config by using ${VAR} syntax, but
DARWIN_USER_TEMP_DIR
is not exposed as a normal env variable to the user (only via getconf), which is different from the linux behavioursource: https://github.com/ryantm/agenix/blob/8d37c5bdeade12b6479c85acd133063ab53187a0/modules/age-home.nix#L148C15-L148C22
Attempt 2: workaround using DAGS
As i noticed the darwin part of home-manager relies on shell, I have tried using a DAG, but now
getconf
is not available as a command in the build context (this currently only works on home-manager unstable,run
is only available there).I am unsure whether either I am using
agenix
incorrectly, or have an incorrect idea on how I am supposed to achieve this. I think not usinggetconf
might also be able to solve this issue for me, but that might have a security impact. I have been unable to find docs on why this is different across Darwin/Linux.Could you point me in the right direction? :)
I would be happy to contribute to docs, when I figure out the proper solution.
The text was updated successfully, but these errors were encountered: