diff options
| author | Fuwn <[email protected]> | 2024-10-11 01:02:32 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-10-11 01:02:32 -0700 |
| commit | cdd4de485ecf4df1ab45b7b35c8c66f69a8c9dd3 (patch) | |
| tree | 97ce29b9dde8b16eb7ccbc26b8bc9a45b02a3672 /README.md | |
| parent | 756d44530f1411f35a532318a377a6fa76efa090 (diff) | |
| download | yae-cdd4de485ecf4df1ab45b7b35c8c66f69a8c9dd3.tar.xz yae-cdd4de485ecf4df1ab45b7b35c8c66f69a8c9dd3.zip | |
docs(readme): add extensive usage instructions
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 64 |
1 files changed, 63 insertions, 1 deletions
@@ -13,9 +13,71 @@ You can try out Yae without installing anything permanently by running Additionally, [Tsutsumi](https://github.com/Fuwn/tsutsumi) uses Yae to manage dependencies. You can check out a working implementation there. +## Usage + +View the [installations instructions](#installation) below to set up Yae after +running `yae init`. + +```sh +# Initialises a Yae environment in the current directory by creating an empty `yae.json` +# file +yae init + +# Adds a Yae dependency named `zen-browser-twilight-bin` using a floating tag +# (tag always remain `twilight`, but may receive frequent hash changes) +yae add \ + --type binary \ + --version twilight \ + --unpack \ + zen-browser-twilight-bin \ + 'https://github.com/zen-browser/desktop/releases/download/{version}/zen.linux-specific.tar.bz2' + +# Adds a Yae dependency named `zen-browser-bin` pinned at tag `1.0.1-a.7` +yae add \ + --type git \ + --version 1.0.1-a.7 \ + --unpack \ + zen-browser-bin \ + 'https://github.com/zen-browser/desktop/releases/download/{version}/zen.linux-specific.tar.bz2' + +# Updates all dependencies, e.g., updates the hash of `zen-browser-twilight-bin` +# and bumps the version of `zen-browser-bin` to `1.0.1-a.8`, handling URI and +# hash recalculations +yae update + +# Only updates `zen-browser-twilight-bin` +yae update zen-browser-twilight-bin +``` + ## Installation -Follow the installation instructions at [Tsutsumi](https://github.com/Fuwn/tsutsumi). +Follow the installation instructions at [Tsutsumi](https://github.com/Fuwn/tsutsumi), +which provides both flake and flake-less installation options. + +Alternatively, without flake-less support, install the +`inputs.yae.packages.${pkgs.system}.yae` package exposed by this flake. + +### Nix + +To add Yae support to your Nix expression after running `yae init`, just read +from the Yae environment file. + +Here's an example taken from [Tsutsumi's zen-browser-bin package](https://github.com/Fuwn/tsutsumi/blob/main/pkgs/zen-browser-bin.nix). + +```nix +# pkgs/zen-browser-bin.nix + +{ + pkgs, + self, + yae ? builtins.fromJSON (builtins.readFile "${self}/yae.json"), +}: +import "${self}/lib/zen-browser-bin.nix" { + # Effortless dependency updates just by running `yae update` from CI using a + # CRON job + inherit (yae.zen-browser-bin) sha256 version; +} { inherit pkgs; } +``` ## `--help` |