ITADN

Can't copy the decrypted secret file

#333Opendarwinx64 创建于 2025-06-04
D
darwinx64commented
Sorry if this isn't the right place for asking this (but maybe this could warrant some documentation for use cases like mine), but I can't seem to figure out how to simply copy a decrypted file to ~/.config. Specifically I encrypted a hosts.yml for GitHub CLI and have been trying to copy it to ~/.config/gh/hosts.yml (where it should be) ```nix { inputs, pkgs, NAME, ... }: { config, ... }: let inherit (inputs) self; in { imports = [ inputs.agenix.homeManagerModules.default ]; home = { packages = with pkgs; [ gh ]; }; programs = { gh = { enable = true; # Tried with and without this to no avail hosts = config.age.secrets."hosts.yml".path; }; }; age = { # I have age.identityPaths in my user's home.nix secrets = { "hosts.yml" = { file = "${self}/secrets/hosts.yml.age"; path = "/home/${NAME}/.config/gh/hosts.yml"; # also tried removing this and only having the programs.gh.hosts above, no luck }; }; }; } ``` The secret is in secrets/hosts.yml.age: ![Image](https://github.com/user-attachments/assets/0f5ca4c0-fdd6-419d-a065-807cbcf26f05) However no matter what I do it seems to either make an invalid symlink pointing to somewhere that doesn't exist or it doesn't make any file at all? I am unsure what I am doing wrong, I am using home manager
0 条评论