{"id":13451484,"url":"https://github.com/tazjin/nixery","last_synced_at":"2025-05-14T10:12:53.242Z","repository":{"id":37460651,"uuid":"199516328","full_name":"tazjin/nixery","owner":"tazjin","description":"Container registry which transparently builds images using the Nix package manager. Canonical repository is https://cs.tvl.fyi/depot/-/tree/tools/nixery","archived":false,"fork":false,"pushed_at":"2025-01-30T02:30:34.000Z","size":887,"stargazers_count":1867,"open_issues_count":35,"forks_count":70,"subscribers_count":28,"default_branch":"master","last_synced_at":"2025-04-13T03:59:21.168Z","etag":null,"topics":["broccoli","container-images","container-registry","docker","kubernetes","nix","nixos"],"latest_commit_sha":null,"homepage":"https://nixery.dev/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tazjin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2019-07-29T19:39:48.000Z","updated_at":"2025-04-10T08:07:28.000Z","dependencies_parsed_at":"2022-06-29T22:00:56.128Z","dependency_job_id":"c6df1305-744a-4e29-8289-225fcffcd7cc","html_url":"https://github.com/tazjin/nixery","commit_stats":{"total_commits":246,"total_committers":10,"mean_commits":24.6,"dds":0.09756097560975607,"last_synced_commit":"e9f7c1fcc8248b69777f773491318938f95370d8"},"previous_names":["google/nixery"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tazjin%2Fnixery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tazjin%2Fnixery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tazjin%2Fnixery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tazjin%2Fnixery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tazjin","download_url":"https://codeload.github.com/tazjin/nixery/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248661706,"owners_count":21141450,"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":["broccoli","container-images","container-registry","docker","kubernetes","nix","nixos"],"created_at":"2024-07-31T07:00:54.587Z","updated_at":"2025-04-13T03:59:27.801Z","avatar_url":"https://github.com/tazjin.png","language":"Go","funding_links":[],"categories":["Go","Deployment Tools","nix","docker"],"sub_categories":["Discovery"],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://nixery.dev/nixery-logo.png\"\u003e\n\u003c/div\u003e\n\n-----------------\n\n[![Build status](https://badge.buildkite.com/016bff4b8ae2704a3bbbb0a250784e6692007c582983b6dea7.svg?branch=refs/heads/canon)](https://buildkite.com/tvl/depot)\n\n**Nixery** is a Docker-compatible container registry that is capable of\ntransparently building and serving container images using [Nix][].\n\nImages are built on-demand based on the *image name*. Every package that the\nuser intends to include in the image is specified as a path component of the\nimage name.\n\nThe path components refer to top-level keys in `nixpkgs` and are used to build a\ncontainer image using a [layering strategy][] that optimises for caching popular\nand/or large dependencies.\n\nA public instance as well as additional documentation is available at\n[nixery.dev][public].\n\nYou can watch the NixCon 2019 [talk about\nNixery](https://www.youtube.com/watch?v=pOI9H4oeXqA) for more information about\nthe project and its use-cases.\n\nThe canonical location of the Nixery source code is\n[`//tools/nixery`][depot-link] in the [TVL](https://tvl.fyi)\nmonorepository. If cloning the entire repository is not desirable, the\nNixery subtree can be cloned like this:\n\n    git clone https://code.tvl.fyi/depot.git:/tools/nixery.git\n\nThe subtree is infrequently mirrored to `tazjin/nixery` on Github.\n\n## Demo\n\nClick the image to see an example in which an image containing an interactive\nshell and GNU `hello` is downloaded.\n\n[![asciicast](https://asciinema.org/a/262583.png)](https://asciinema.org/a/262583?autoplay=1)\n\nTo try it yourself, head to [nixery.dev][public]!\n\nThe special meta-package `shell` provides an image base with many core\ncomponents (such as `bash` and `coreutils`) that users commonly expect in\ninteractive images.\n\n## Feature overview\n\n* Serve container images on-demand using image names as content specifications\n\n  Specify package names as path components and Nixery will create images, using\n  the most efficient caching strategy it can to share data between different\n  images.\n\n* Use private package sets from various sources\n\n  In addition to building images from the publicly available Nix/NixOS channels,\n  a private Nixery instance can be configured to serve images built from a\n  package set hosted in a custom git repository or filesystem path.\n\n  When using this feature with custom git repositories, Nixery will forward the\n  specified image tags as git references.\n\n  For example, if a company used a custom repository overlaying their packages\n  on the Nix package set, images could be built from a git tag `release-v2`:\n\n  `docker pull nixery.thecompany.website/custom-service:release-v2`\n\n* Efficient serving of image layers from Google Cloud Storage\n\n  After building an image, Nixery stores all of its layers in a GCS bucket and\n  forwards requests to retrieve layers to the bucket. This enables efficient\n  serving of layers, as well as sharing of image layers between redundant\n  instances.\n\n## Configuration\n\nNixery supports the following configuration options, provided via environment\nvariables:\n\n* `PORT`: HTTP port on which Nixery should listen\n* `NIXERY_CHANNEL`: The name of a Nix/NixOS channel to use for building\n* `NIXERY_PKGS_REPO`: URL of a git repository containing a package set (uses\n  locally configured SSH/git credentials)\n* `NIXERY_PKGS_PATH`: A local filesystem path containing a Nix package set to\n  use for building\n* `NIXERY_STORAGE_BACKEND`: The type of backend storage to use, currently\n  supported values are `gcs` (Google Cloud Storage) and `filesystem`.\n\n  For each of these additional backend configuration is necessary, see the\n  [storage section](#storage) for details.\n* `NIX_TIMEOUT`: Number of seconds that any Nix builder is allowed to run\n  (defaults to 60)\n* `NIX_POPULARITY_URL`: URL to a file containing popularity data for\n  the package set (see `popcount/`)\n\nIf the `GOOGLE_APPLICATION_CREDENTIALS` environment variable is set to a service\naccount key, Nixery will also use this key to create [signed URLs][] for layers\nin the storage bucket. This makes it possible to serve layers from a bucket\nwithout having to make them publicly available.\n\nIn case the `GOOGLE_APPLICATION_CREDENTIALS` environment variable is not set, a\nredirect to storage.googleapis.com is issued, which means the underlying bucket\nobjects need to be publicly accessible.\n\n### Storage\n\nNixery supports multiple different storage backends in which its build cache and\nimage layers are kept, and from which they are served.\n\nCurrently the available storage backends are Google Cloud Storage and the local\nfile system.\n\nIn the GCS case, images are served by redirecting clients to the storage bucket.\nLayers stored on the filesystem are served straight from the local disk.\n\nThese extra configuration variables must be set to configure storage backends:\n\n* `GCS_BUCKET`: Name of the Google Cloud Storage bucket to use (**required** for\n  `gcs`)\n* `GOOGLE_APPLICATION_CREDENTIALS`: Path to a GCP service account JSON key\n  (**optional** for `gcs`)\n* `STORAGE_PATH`: Path to a folder in which to store and from which to serve\n  data (**required** for `filesystem`)\n\n### Background\n\nThe project started out inspired by the [buildLayeredImage][] blog post with the\nintention of becoming a Kubernetes controller that can serve declarative image\nspecifications specified in CRDs as container images. The design for this was\noutlined in [a public gist][gist].\n\n## Roadmap\n\n### Kubernetes integration\n\nIt should be trivial to deploy Nixery inside of a Kubernetes cluster with\ncorrect caching behaviour, addressing and so on.\n\nSee [issue #4](https://github.com/tazjin/nixery/issues/4).\n\n### Nix-native builder\n\nThe image building and layering functionality of Nixery will be extracted into a\nseparate Nix function, which will make it possible to build images directly in\nNix builds.\n\n[Nix]: https://nixos.org/\n[layering strategy]: https://tazj.in/blog/nixery-layers\n[gist]: https://gist.github.com/tazjin/08f3d37073b3590aacac424303e6f745\n[buildLayeredImage]: https://grahamc.com/blog/nix-and-layered-docker-images\n[public]: https://nixery.dev\n[depot-link]: https://code.tvl.fyi/tree/tools/nixery\n[gcs]: https://cloud.google.com/storage/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftazjin%2Fnixery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftazjin%2Fnixery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftazjin%2Fnixery/lists"}