• This repository has been archived on 24/May/2023
  • Stars
    star
    103
  • Rank 325,400 (Top 7 %)
  • Language
    Rust
  • License
    MIT License
  • Created over 2 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Nix binary cache implemented in rust using libnix-store

harmonia

THIS REPOSITORY HAS MOVED TO https://github.com/nix-community/harmonia! The helsinki-systems/harmonia repository is unmaintained.

Features

  • http-ranges support for nar file streaming
  • streaming build logs
  • .ls file streaming
    • Note: doesn't contain narOffset in json response but isn't needed for nix-index

Build

Whole application

nix-shell --run cargo b

Configuration

Configuration is done via a toml file. The location of the configuration file should be passed as env var CONFIG_FILE. If no config file is passed the following default values will be used:

bind = "127.0.0.1:8080"
workers = 4
max_connection_rate = 256
priority = 30

Per default we wont sign any narinfo because we don't have a secret key, to enable this feature enable it by providing a path to a private key generated by nix-store --generate-binary-cache-key cache.example.com-1 /etc/nix/cache.sk /etc/nix/cache.pk

sign_key_path = "/run/secrets/key"

Logging can be configured with env_logger. The default value is info,actix_web=debug. To only log errors use the following RUST_LOG=error and to only disable access logging, use RUST_LOG=info,actix_web::middleware=error

Run tests

nix-build -E 'with import <nixpkgs> {}; callPackage ./test.nix {nixpkgs = pkgs;}'

Inspiration