{"id":17492678,"url":"https://github.com/fuwn/yae","last_synced_at":"2025-04-22T21:29:38.620Z","repository":{"id":258037714,"uuid":"870952644","full_name":"Fuwn/yae","owner":"Fuwn","description":"⛩️ Powerful yet Minimal Nix Dependency Manager","archived":false,"fork":false,"pushed_at":"2025-01-03T08:59:37.000Z","size":154,"stargazers_count":26,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-16T05:32:23.079Z","etag":null,"topics":["dependencies","home-manager","niv","nix","nixos","npins"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Fuwn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-11T01:22:26.000Z","updated_at":"2025-04-14T03:46:17.000Z","dependencies_parsed_at":"2024-10-25T12:59:01.495Z","dependency_job_id":"c1c9c727-ad34-42ff-b825-45434b67b023","html_url":"https://github.com/Fuwn/yae","commit_stats":{"total_commits":68,"total_committers":1,"mean_commits":68.0,"dds":0.0,"last_synced_commit":"6bc492fe65c567dced04771c9729702d1c7d5154"},"previous_names":["fuwn/yae","fuwn/wiene"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fuwn%2Fyae","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fuwn%2Fyae/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fuwn%2Fyae/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fuwn%2Fyae/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Fuwn","download_url":"https://codeload.github.com/Fuwn/yae/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250327846,"owners_count":21412511,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dependencies","home-manager","niv","nix","nixos","npins"],"created_at":"2024-10-19T10:05:58.134Z","updated_at":"2025-04-22T21:29:38.604Z","avatar_url":"https://github.com/Fuwn.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ⛩️ Yae\n\nYae is a powerful yet minimal dependency manager intended for use with Nix,\nwhich functions similar to [niv](https://github.com/nmattia/niv/) and [`npins`](https://github.com/andir/npins/).\n\n\u003cdetails closed\u003e\n  \u003csummary\u003eWhy should I consider Yae over niv or \u003ccode\u003enpins\u003c/code\u003e?\u003c/summary\u003e\n\n  1. No unnecessary helper Nix expressions are needed by Yae.\n\n     niv and `npins` spit out medium-to-large sized Nix expressions that vary in\n     complexity in the form of a file that you need to keep in sync with their\n     mainline sources. This requires additional upgrade commands in the CLI and\n     more effort to maintain. A Yae environment is a single file and can be placed\n     anywhere and read just as simply.\n  2. Yae has a simple and coherent source tree. niv has a total of 10000 LOC\n     (lines of code), `npins` sits at almost 6000 LOC flat, and Yae stands at just\n     shy of 1500 LOC when looking at all files. Yae's core source code itself sits\n     at just 462 LOC, which is much, **much** smaller than that of niv and `npins`'\n     core trees. This is all to say that Yae implements everything needed to functionally\n     replace niv and `npins` in any workflow, and in much more efficient and concise\n     codebase.\n  3. Yae is simple by nature in design and usage philosophy.\n\n     niv and `npins` are great, but are far too ~~overkill~~ overengineered for me\n     and many other consumers. I say overengineered because I was able to write out\n     Yae's initial implementation in just about thirty-minutes to an hour, and it\n     was already complete enough for me to replace niv or `npins` in all of my production\n     workflows. If you need some niche feature that niv or `npins` has, use them,\n     but if not, Yae is here for you.\n\n\u003c/details\u003e\n\n## Introduction\n\nYou can try out Yae without installing anything permanently on your system by running\n`nix run github:Fuwn/yae`.\n\nCheck out [Tsutsumi](https://github.com/Fuwn/tsutsumi) to see an example of Yae running\nin a production environment. Tsutsumi fully leverages the power of Yae to manage\nand automagically update the sources of the Nix packages it provides using a simple\nGitHub Actions CRON workflow.\n\n## Usage\n\nView the [installations instructions](#installation) below to set up Yae after\nrunning `yae init`.\n\n### Example Environment Setup\n\n```sh\n# Initialises a Yae environment in the current directory by creating an empty `yae.json`\n# file\nyae init\n\n# Adds a Yae dependency named `zen-browser-twilight-bin` using a floating tag\n# (tag always remain `twilight`, but may receive frequent hash changes)\nyae add \\\n  --type binary \\\n  --version twilight \\\n  --unpack \\\n  zen-browser-twilight-bin \\\n  'https://github.com/zen-browser/desktop/releases/download/{version}/zen.linux-specific.tar.bz2'\n\n# Adds a Yae dependency named `zen-browser-bin` pinned at tag `1.0.1-a.7`\nyae add \\\n  --type git \\\n  --version 1.0.1-a.7 \\\n  --unpack \\\n  zen-browser-bin \\\n  'https://github.com/zen-browser/desktop/releases/download/{version}/zen.linux-specific.tar.bz2'\n\n# Adds a Yae dependency named `yaak` pinned at tag `2024.10.1` with tag trimming\n# for updates\nyae add \\\n  --type git \\\n  --unpack=false \\\n  --version 2024.10.1 \\\n  --trim-tag-prefix v \\\n  yaak \\\n  'https://github.com/yaakapp/app/releases/download/v{version}/yaak_{version}_amd64.AppImage.tar.gz'\n\n# Updates all dependencies, e.g., updates the hash of `zen-browser-twilight-bin`\n# and bumps the version of `zen-browser-bin` to `1.0.1-a.8`, handling URL and\n# hash recalculations, etc.\nyae update\n\n# Only updates `zen-browser-twilight-bin`\nyae update zen-browser-twilight-bin\n```\n\n## Installation\n\nYou can either install Yae through the flake that this repository exposes or\nthrough [Tsutsumi](https://github.com/Fuwn/tsutsumi).\n\n[Tsutsumi](https://github.com/Fuwn/tsutsumi) provides both flake and flake-less installation\noptions, while this repository only provides installation support through flakes\nusing the exported `inputs.yae.packages.${pkgs.system}.yae` package.\n\n\u003cdetails closed\u003e\n  \u003csummary\u003eClick here to see a minimal Nix flake that exposes a development shell with Yae bundled.\u003c/summary\u003e\n\n```nix\n# Enter the development shell using `nix develop --impure` (impure is used here because `nixpkgs` internally\n# assigns `builtins.currentSystem` to `nixpkgs.system` for the sake of simplicity in this example)\n{\n  inputs.nixpkgs.url = \"github:NixOS/nixpkgs/nixpkgs-unstable\";\n\n  inputs.tsutsumi = {\n    url = \"github:Fuwn/tsutsumi\";\n    inputs.nixpkgs.follows = \"nixpkgs\";\n  };\n\n  outputs = { nixpkgs, tsutsumi, self }:\n    let pkgs = import nixpkgs { inherit self; }; in {\n      devShells.${pkgs.system}.default = pkgs.mkShell {\n        buildInputs = [ tsutsumi.packages.${pkgs.system}.yae ];\n      };\n    };\n}\n```\n\n\u003c/details\u003e\n\n### Integrating with Nix\n\nTo add Yae support to your Nix expression after running `yae init`, just read\nfrom the Yae environment file. See the example below for more details.\n\n### Examples\n\nCheck out the [`examples/`](./examples) directory for a couple of great examples\nof Yae managing different sources including Nixpkgs!\n\n#### Real-world Example\n\nHere's an example snippet taken from Tsutsumi's [`zen-browser-bin` package](https://github.com/Fuwn/tsutsumi/blob/main/pkgs/zen-browser-bin.nix)\nand [`yae.json`](https://github.com/Fuwn/tsutsumi/blob/main/yae.json#L59-L67)\nshowcasing Yae in action.\n\n\u003cdetails closed\u003e\n  \u003csummary\u003eExpand this!\u003c/summary\u003e\n\n```nix\n# pkgs/zen-browser-bin.nix\n\n# This expression produces the `zen-browser-bin` package that Tsutsumi exposes\n# as a Nix package derivation.\n#\n# Since it is managed by Yae, it is kept 100% up to date with zero effort through\n# a Github Actions CRON job workflow that executes `yae update` periodically.\n{\n  pkgs,\n  self,\n  # This line imports Yae's environment configuration to be used below.\n  yae ? builtins.fromJSON (builtins.readFile \"${self}/yae.json\"),\n}:\n# Tsutsumi exposes two versions of the Zen browser, the latest stable release\n# and the latest Twilight release (a bleeding edge, daily build). This library\n# function is one that takes one of two Yae sources for the Zen browser, and produces\n# a Nix package derivation for it.\nimport \"${self}/lib/zen-browser-bin.nix\" {\n  # Here, the latest SHA256 hash and release version from Yae are passed to Tsutsumi's\n  # Zen browser package function.\n  #\n  # If `yae update` is ran and a new release is detected, these values are\n  # updated by Yae, which then triggers another workflow to build and send the\n  # resulting derivation to Tsutsumi's binary cache.\n  inherit (yae.zen-browser-bin) sha256 version;\n\n  # To generate the Twilight release package, this is all that is changed.\n  # inherit (yae.zen-browser-twilight-bin) sha256 version;\n} { inherit pkgs; }\n```\n\n\u003c/details\u003e\n\n## `--help`\n\n```text\nNAME:\n   yae - Nix Dependency Manager\n\nUSAGE:\n   yae [global options] command [command options]\n\nDESCRIPTION:\n   Nix Dependency Manager\n\nAUTHOR:\n   Fuwn \u003ccontact@fuwn.me\u003e\n\nCOMMANDS:\n   init     Initialise a new Yae environment\n   add      Add a source\n   drop     Drop a source\n   update   Update one or all sources\n   help, h  Shows a list of commands or help for one command\n\nGLOBAL OPTIONS:\n   --sources value  Sources path (default: \"./yae.json\")\n   --debug          Enable debug output (default: false)\n   --silent         Silence log output (default: false)\n   --dry-run        Prevents writing to disk (default: false)\n   --help, -h       show help\n\nCOPYRIGHT:\n   Copyright (c) 2024-2024 Fuwn\n```\n\n## Licence\n\nThis project is licensed with the [GNU General Public License v3.0](./LICENSE.txt).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuwn%2Fyae","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffuwn%2Fyae","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuwn%2Fyae/lists"}