Description
agenix keeps secrets encrypted in a Nix configuration. It encrypts each secret with the SSH public keys of the machines or users allowed to read it, using the age format, so the encrypted files can be stored in Git and deployed with Nix without exposing their contents. age files, and the NixOS and Home Manager modules decrypt the secrets when the system activates, for the intended machine or user. nix file in a secrets directory, and then create an encrypted secret with a single nix run command. You then declare the secret in a NixOS module, and the decrypted file is placed where the service expects it. The project documents installation with flakes, niv, nix-channel or fetchTarball, including Home Manager setup, and it provides reference pages for the NixOS module, the Home Manager module and the CLI. It also includes a threat model with warnings about what the approach does and does not protect. The project is hosted on GitHub, and help is handled through GitHub issues. It is aimed at people who run NixOS or Home Manager and want their configuration and secrets to live in the same repository.…
Highlights
- Secrets encrypted with SSH public keys
- age-encrypted files that can live in Git
- NixOS and Home Manager modules
- CLI to create and rekey secrets
- Threat model documented
Ratings & Reviews
No ratings yet
Be the first to rate Agenix.
People also visit
Agenix FAQ
What is agenix?
A tool for storing age-encrypted secrets in a NixOS or Home Manager configuration, decrypted at activation time.
Is it free?
Yes. It is open source and hosted on GitHub.
How are secrets encrypted?
With the SSH public keys of the machines or users listed in an agenix-rules.nix file.
How do I create a secret?
Run nix run github:ryantm/agenix -- -e example.age in your secrets directory, after listing the allowed keys in agenix-rules.nix.
How do I install it?
The docs cover flakes, niv, nix-channel and fetchTarball, with a Home Manager option.
Where can I read about its limits?
The project has a threat model and warnings page in its documentation.
What are the best Agenix alternatives?
Popular alternatives to Agenix include git-secret, Nix Mineral and Hasp. See all Agenix alternatives


