diff options
| author | Fuwn <[email protected]> | 2024-10-15 17:20:21 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-10-15 17:20:24 -0700 |
| commit | cb55fdc17bab297a16cf47acc850dce58e8ced87 (patch) | |
| tree | 291c616a33f14c5da4168c423d424271a3ed48fc /README.md | |
| parent | 27eefbc75f85d44bdf70addfef67319d840141eb (diff) | |
| download | yae-cb55fdc17bab297a16cf47acc850dce58e8ced87.tar.xz yae-cb55fdc17bab297a16cf47acc850dce58e8ced87.zip | |
docs: add nixpkgs examples
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 19 |
1 files changed, 18 insertions, 1 deletions
@@ -109,12 +109,28 @@ exported `inputs.yae.packages.${pkgs.system}.yae` package. To add Yae support to your Nix expression after running `yae init`, just read from the Yae environment file. See the example below for more details. -### Nix Example +### Examples + +Check out [`examples/nixpkgs`](./examples/nixpkgs) for a pure Nix example of Yae +in action. This example is a little large since it constrains itself to **zero** +inputs and manually constructs multi-system support. In a real-world scenario, +you'd actually use something like [flake-utils](https://github.com/numtide/flake-utils) +to replace all of the boilerplate. For this reason, [`examples/nixpkgs-simple`](./examples/nixpkgs-simple) +exists, which functions identically, but uses `builtins.currentSystem` to +populate the `nixpkgs.system` attribute. (requires `--impure`) + +If Nixpkgs ever goes out of date in these theorectical examples, just run +`yae update`! + +#### Real-world Example Here's an example snippet taken from Tsutsumi's [`zen-browser-bin` package](https://github.com/Fuwn/tsutsumi/blob/main/pkgs/zen-browser-bin.nix) and [`yae.json`](https://github.com/Fuwn/tsutsumi/blob/main/yae.json#L59-L67) showcasing Yae in action. +<details closed> + <summary>Expand this!</summary> + ```nix # pkgs/zen-browser-bin.nix @@ -146,6 +162,7 @@ import "${self}/lib/zen-browser-bin.nix" { # inherit (yae.zen-browser-twilight-bin) sha256 version; } { inherit pkgs; } ``` +</details> ## `--help` |