snix/contrib/fetchroots
Starnick4444 f242bc6df8 chore(contrib): upgrade to 2024 edition
Part of #114
This edition change doesn't affect these crates except for formatting.

Change-Id: I441c967b6803f1f839379c2ec13dee3f0958fb05
Reviewed-on: https://cl.snix.dev/c/snix/+/30593
Autosubmit: Bence Nemes <nemes.bence1@gmail.com>
Reviewed-by: Ilan Joselevich <personal@ilanjoselevich.com>
Reviewed-by: Florian Klink <flokli@flokli.de>
Tested-by: besadii
2025-07-04 18:19:41 +00:00
..
src chore(contrib): upgrade to 2024 edition 2025-07-04 18:19:41 +00:00
.gitignore chore(users/edef): move to contrib 2025-03-17 17:15:08 +00:00
Cargo.lock feat(contrib/fetchroots): track git revisions 2025-04-04 16:41:32 +00:00
Cargo.nix chore(contrib): upgrade to 2024 edition 2025-07-04 18:19:41 +00:00
Cargo.toml chore(contrib): upgrade to 2024 edition 2025-07-04 18:19:41 +00:00
default.nix chore(users/edef): move to contrib 2025-03-17 17:15:08 +00:00
README.md chore(users/edef): move to contrib 2025-03-17 17:15:08 +00:00
rustfmt.toml chore(contrib): upgrade to 2024 edition 2025-07-04 18:19:41 +00:00

fetchroots

This tool is part of a suite of tools built to manage cache.nixos.org.

This tool's purpose is to build an index of all the GC roots from the channels.nixos.org releases. The result is then combined with other tools.

It does this by:

  1. Listing all the release files in the bucket.
  2. Getting the data for each of the release.
  3. Putting them in a local parquet file.

Getting started

In order to run this, you'll need AWS SSO credentials from the NixOS Infra team.

Get the creds from https://nixos.awsapps.com/start/ -> LBNixOS_Dev_PDX -> AWSReadOnlyAccess.

Run mg run, you should see a progress bar.

Congrats, you now have a roots.parquet file. You can now load it with python polars-rs or clickhouse.

roots.parquet file format

  • key (String): the release, eg nixos/22.11-small/nixos-22.11.513.563dc6476b8
  • timestamp (DateTime): the timestamp of the GC roots file for this release
  • store_path_hash (List[Binary]): hash part of the store paths rooted by this release

Development

When the Cargo.lock changes, run mg run //tools:crate2nix-generate.

To build the project, run mg build.

To get a dev environment, run nix-shell -p cargo.