Skip to content
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

No docs on how to use agenix with home-manager #306

Open
taciturnaxolotl opened this issue Jan 6, 2025 · 1 comment
Open

No docs on how to use agenix with home-manager #306

taciturnaxolotl opened this issue Jan 6, 2025 · 1 comment

Comments

@taciturnaxolotl
Copy link

I've tried directly reading the file (even though ik its an anti pattern but just to check) and nix actually does deny that which is nice. Trying to access the secret through config.age.secrets.xxx.path results in an error stating that that doesn't exist on config. Is there any offical way to do this?

warning: Git tree '/home/kierank/etc/nixos' is dirty
building the system configuration...
warning: Git tree '/home/kierank/etc/nixos' is dirty
error:
       … while calling the 'head' builtin
         at /nix/store/hq74z1248f21rs5lcig5hmpqn08lv9n8-source/lib/attrsets.nix:1574:11:
         1573|         || pred here (elemAt values 1) (head values) then
         1574|           head values
             |           ^
         1575|         elsewhile evaluating the attribute 'value'
         at /nix/store/hq74z1248f21rs5lcig5hmpqn08lv9n8-source/lib/modules.nix:816:9:
          815|     in warnDeprecation opt //
          816|       { value = addErrorContext "while evaluating the option `${showOption loc}':" value;
             |         ^
          817|         inherit (res.defsFinal') highestPrio;

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: attribute 'age' missing
       at /nix/store/4l1lmxg6cqgsl7ind29ahgsvg8yz8lpn-source/home-manager/app/cider.nix:15:16:
           14|       path = builtins.fetchurl {
           15|         url =  config.age.secrets.cider.path;
             |                ^
           16|         sha256 = "0zwyin85knvlbkbilm2sdf5k2h12z5f624lb3bfyy2sbxvc9dp2x";
@taciturnaxolotl
Copy link
Author

nvm i feel a bit silly; you need to import inputs.agenix.homeManagerModules.default and then define your secrets. It would definetly be very helpful to add docs for this

@taciturnaxolotl taciturnaxolotl changed the title Is there a way to access agenix secrets in home manager? No docs on how to use agenix with home-manager Jan 7, 2025
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

No branches or pull requests

1 participant