I’m trying to set up agenix through Home Manager, but the userspace systemd process has an error.
A line from systemctl status --user agenix.service:
Nov 07 17:12:31 lydia agenix-home-manager-mount-secrets[4852]: age: error: failed to obtain passphrase: could not read passphrase for "/home/rocky/.ssh/id_ed25519": standard input is not a terminal, and /dev/tty is not available: open /dev/tty: no such device or address
How I set this up in my flake.nix:
{
nixosConfigurations.lydia = nixpkgs.lib.nixosSystem {
[...]
modules = [
[...]
agenix.nixosModules.default
];
};
}
How I set up a secret later for my Restic config in home.nix:
{
age.secrets.restic-password.file = ./secrets/restic-password.age;
home.sessionVariables = {
[...]
RESTIC_PASSWORD_FILE = config.age.secrets.restic-password.path;
};
}
Full output of \`systemct status --user agenix.service\`
× agenix.service - agenix activation
Loaded: loaded (/home/rocky/.config/systemd/user/agenix.service; enabled; preset: ignored)
Active: failed (Result: exit-code) since Sat 2026-11-07 17:12:31 MST; 6h ago
Invocation: 9512c5bceb0a4dec8818016b75409fa0
Main PID: 4842 (code=exited, status=1/FAILURE)
Mem peak: 3M
CPU: 89ms
Nov 07 17:12:31 lydia systemd[3638]: Starting agenix activation…
Nov 07 17:12:31 lydia agenix-home-manager-mount-secrets[4842]: [agenix] creating new generation in /run/user/1000/agenix.d/1
Nov 07 17:12:31 lydia agenix-home-manager-mount-secrets[4842]: [agenix] decrypting secrets…
Nov 07 17:12:31 lydia agenix-home-manager-mount-secrets[4842]: [agenix] WARNING: config.age.identityPaths entry /home/rocky/.ssh/id_rsa not present!
Nov 07 17:12:31 lydia agenix-home-manager-mount-secrets[4842]: decrypting ‘/nix/store/279ynja0mmfq1rhlasrwgbjb265fj5cq-restic-password.age’ to ‘/run/user/1000/agenix.d/1/restic-password’…
Nov 07 17:12:31 lydia agenix-home-manager-mount-secrets[4852]: age: error: failed to obtain passphrase: could not read passphrase for “/home/rocky/.ssh/id_ed25519”: standard input is not a terminal, and /dev/tty is not available: open /dev/tty: no such device or address
Nov 07 17:12:31 lydia agenix-home-manager-mount-secrets[4852]: age: report unexpected or unhelpful errors at
Nov 07 17:12:31 lydia systemd[3638]: agenix.service: Main process exited, code=exited, status=1/FAILURE
Nov 07 17:12:31 lydia systemd[3638]: agenix.service: Failed with result ‘exit-code’.
Nov 07 17:12:31 lydia systemd[3638]: Failed to start agenix activation.