MCPcopy Index your code
hub / github.com/cafkafk/nix-weather

github.com/cafkafk/nix-weather @v0.0.4

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.0.4 ↗ · + Follow
10 symbols 18 edges 8 files 1 documented · 10%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Nix Weather - Check Cache Availablility of NixOS Configurations

A fast rust tool to check availability of your entire system in caches. It so to speak "checks the weather" before going to update. Heavily inspired by guix weather.

Built with Nix Contributor Covenant REUSE status License: EUPL-1.2

Usage

Note Currently, nix-weather only has first-class support for flakes.

General usage would be like this:

nix-weather --name myhost --config ~/git/my-nixos-config

Here, we specify the name of the host, as specified at the flake output nixosConfiguration, and a path to the NixOS configuration flake.

How It Works

The basic idea is that we construct a set of all requisites to build the top-level of a NixOS configuration, and then query Nix cache(s) for the narinfo. By doing this in a high concurrency, parallel task runner (i.e. tokio async runtime), and only querying the headers for status codes, we can reach impressive speeds, typically around 45~ network time.

One of the biggest limiting factors regarding speed is building the config.system.toplevel, and finding the necessary requisites with nix-store. Caching the requisites is a future goal, so that we only have to build the toplevel, and then match against its derivation in cache, which should cut down the nix part of the runtime by ~80%.

Contributing

For information on contributing, please see CONTRIBUTING.md.

Core symbols most depended-on inside this repo

build_cli
called by 2
crates/nix-weather/src/cli.rs
get_config_drv_path
called by 1
crates/nix-weather/src/nix.rs
get_installable_drv_path
called by 1
crates/nix-weather/src/nix.rs
get_requisites_from_drv_path
called by 1
crates/nix-weather/src/nix.rs
requisites_to_hashes
called by 1
crates/nix-weather/src/nix.rs
get_requisites
called by 1
crates/nix-weather/src/nix.rs
nar_exists
called by 1
crates/nix-weather/src/net.rs
main
called by 0
crates/nix-weather/build.rs

Shape

Function 10

Languages

Rust100%

Modules by API surface

crates/nix-weather/src/nix.rs5 symbols
crates/workspace-hack/build.rs1 symbols
crates/nix-weather/src/net.rs1 symbols
crates/nix-weather/src/main.rs1 symbols
crates/nix-weather/src/cli.rs1 symbols
crates/nix-weather/build.rs1 symbols

For agents

$ claude mcp add nix-weather \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page