Extend flake install section

This commit is contained in:
malteneuss 2023-07-16 21:34:50 +02:00 committed by GitHub
parent 6d20bf81f8
commit 1d7fd15690
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 25 additions and 2 deletions

View File

@ -199,13 +199,14 @@ To install the `agenix` binary:
#### Install CLI via Flakes
You don't need to install it,
You can run the CLI tool ad-hoc without installing it:
```ShellSession
nix run github:ryantm/agenix -- --help
```
but, if you want to (change the system based on your system):
But you can also add it permanently into a [NixOS module](https://nixos.wiki/wiki/NixOS_modules)
(replace system "x86_64-linux" with your system):
```nix
{
@ -213,6 +214,28 @@ but, if you want to (change the system based on your system):
}
```
e.g. inside your `flake.nix` file:
```nix
{
inputs.agenix.url = "github:ryantm/agenix";
# ...
outputs = { self, nixpkgs, agenix }: {
# change `yourhostname` to your actual hostname
nixosConfigurations.yourhostname = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
# ...
{
environment.systemPackages = [ agenix.packages.${system}.default ];
}
];
};
};
}
```
</details>
## Tutorial