diff --git a/README.md b/README.md index 204a974..a238f82 100644 --- a/README.md +++ b/README.md @@ -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 ]; + } + ]; + }; + }; +} +``` + ## Tutorial