Peerix is a peer-to-peer binary cache for nix derivations

Related tags

Caching peerix
Overview

Peerix

Peerix is a peer-to-peer binary cache for nix derivations. Every participating node can pull derivations from each other instances' respective nix-stores.

How does it work?

Peerix implements a nix binary cache. When the nix package manager queries peerix, peerix will ask the network if any other peerix instances hold the package, and if some other instance holds the derivation, it will download the derivation from that instance.

Installation

There is a nix-module located at module.nix that configures your nixos-installation to automatically use peernix.

These Options exist:

Option Description
services.peerix.enable Enables Peerix
services.peerix.openFirewall Open the neccessary firewall ports.
services.peerix.user What user should the peerix service run under.
services.peerix.group What group should the peerix service run under.
services.peerix.privateKeyFile A path to the file that contains the path to the private key to sign your derivations.
services.peerix.publicKeyFile A path to the file that contains the path to the public key so nix can verify the signature.

To sign the peerix cache, you can use nix-store --generate-binary-cache-key to create keys to verify authenticity of the packages in each nix-store.

Comments
  • Extra spaces in store paths

    Extra spaces in store paths

    When activating two peerix instances, one local, and one on another machine in the same network, nixos-rebuild fails with the following: error: store path 'nfc84fq55dbzxa6f6wsc67ib9ggm5yfn-nixos-manual-html.drv ' contains illegal character ' '. Unfortunately, the error is transient, and I cannot reproduce it reliably. Every time I rerun nixos-rebuild, a different store path is emitted along with the error. Maybe something wrong with Narinfo parsing?

    opened by ilikeavocadoes 4
  • flake.nix: use follows for nixpkgs and flake-utils

    flake.nix: use follows for nixpkgs and flake-utils

    This make mach-nix use the same nixpkgs and flake-utils than the peerix flake.

    You can see with nix flake info.

    This PR should be merged (and rebased first) after #7.

    opened by bbigras 2
  • nix.binaryCaches and nix.binaryCachePublicKeys have been renamed

    nix.binaryCaches and nix.binaryCachePublicKeys have been renamed

    Some options changed

    trace: warning: The option `nix.binaryCaches' defined in `/nix/store/r2bbhmlfvfpir9hp8fjs31kj13kwgwyl-source/flake.nix' has been renamed to `nix.settings.substituters'.
    trace: warning: The option `nix.binaryCachePublicKeys' defined in `/nix/store/r2bbhmlfvfpir9hp8fjs31kj13kwgwyl-source/flake.nix' has been renamed to `nix.settings.trusted-public-keys'.
    
    opened by rapenne-s 1
  • Peerix substituters are ignored because of missing trusted public key

    Peerix substituters are ignored because of missing trusted public key

    I'm currently writing a guide explaining how to setup peerix, but I first need to get it working for me :sweat_smile:

    I have peerix correctly installed on two nixos, service are running, I generated the keys on both using nix-store --generate-binary-cache-key $machine_name peerix-private peerix-public.

    On computer B, I added computer A public key as services.peerix.publicKey. I switched to the new configuration, the key is definitely in /etc/nix/nix.conf.

    When on B I tried to use packages found in A, I have this error:

    warning: ignoring substitute for '/nix/store/qh84nk49gxhmf0gr5g5rjpxvn9li1ic5-libiec61883-1.2.0' from 'http://127.0.0.1:12304', as it's not signed by any of the keys in 'trusted-public-keys'
    

    Everything looks fine to me :thinking:

    Here is my flake.nix file enabling peerix

                peerix.nixosModules.peerix
                {
                  services.peerix = {
                    package = peerix.packages.x86_64-linux.peerix;
                    enable = true;
                    openFirewall = true;
                    privateKeyFile = ./peerix-private;
                    publicKeyFile =  ./peerix-public;
                    publicKey = "t470:uMRQTGoQNSnGOmok7OKPEgliBlut6lQaBVT2NUIzEi0=";
                  };
                }
    
    opened by rapenne-s 1
  • On second thought, maybe we should add `.editorconfig`?

    On second thought, maybe we should add `.editorconfig`?

    On second thought, maybe we should add .editorconfig?

    Originally posted by @danielphan2003 in https://github.com/cid-chan/peerix/pull/2#discussion_r741449910

    opened by cid-chan 1
  • update nix options to silence warning

    update nix options to silence warning

    Hello!

    The nix module options have changed (mostly stuff is now located at nix.settings):

    trace: warning: The option `nix.binaryCaches' defined in `/nix/store/mwckgsmvqily7njdxqqbl647fdsp0wna-source/hosts/common/global/peerix.nix' has been renamed to `nix.settings.substituters'.
    trace: warning: The option `nix.binaryCachePublicKeys' defined in `/nix/store/mwckgsmvqily7njdxqqbl647fdsp0wna-source/hosts/common/global/peerix.nix' has been renamed to `nix.settings.trusted-public-keys'.
    

    Here's a quick patch updating them to the newer versions.

    Thanks!

    opened by Misterio77 0
  • add overlay and various fixes

    add overlay and various fixes

    Add overlay and services.peerix.package

    Other fixes include

    • changing type of services.peerix.publicKey to string,
    • use pname for mach-nix, remove newline in VERSION.

    All in all, this should not affect non-flake users.

    opened by danielphan2003 0
  • Add options to directly contact hosts by name or ip + disable broadcast

    Add options to directly contact hosts by name or ip + disable broadcast

    Following options are added

    • extraHosts enables the specification of hostnames/ips to specifically contact
    • disableBroadcast would avoid to use the broadcast addresses from the interfaces by default

    Those options are added using two env variables:

    • comma-separated PEERIX_EXTRA_HOSTS
    • boolean PEERIX_DISABLE_BROADCAST (true or false in string)

    Also puts a small example in the README.MD.

    Use case:

    1. Use a VPN such as tailscale, aka a mesh vpn to connect multiple computers together, independantly of the network
    2. Broadcast interfaces are not a feature of any VPN
    3. Peerix can still be used accross networks thanks to a module defined such as:
       _: {
         services.peerix = {
           enable = true;
           openFirewall = true; # UDP/12304
      
           privateKeyFile = ../secrets/peerix-private;
           publicKeyFile = ../secrets/peerix-public;
      
           user = "peerix";
           group = "peerix";
      
           disableBroadcast = true;
           extraHosts = [ "my-nixos-computer-hostname" "42.42.42.1" ];
         };
         users.users.peerix = {
           isSystemUser = true;
           group = "peerix";
         };
         users.groups.peerix = { };
       }
      
    opened by VolodiaPG 0
  • Make services.peerix.publicKey / services.peerix.publicKeyFile a list

    Make services.peerix.publicKey / services.peerix.publicKeyFile a list

    I think these options should be called services.peerix.publicKeys and services.peerix.publicKeyFiles, since multiple public keys should usually be accepted, and it should be easy to change (I can try to make a PR in the future).

    opened by laikq 0
  • Feature request: try nix-serve-ng

    Feature request: try nix-serve-ng

    nix-serve-ng is a drop-in replacement for nix-serve that is advertised as a lot faster

    I think this could be an interesting option for peerix, and may solve the issues with timeout. I expect most users to run it on workstations that may not be super fast, improving the efficiency is important.

    opened by rapenne-s 0
  • Untrusted peerix on a network can lead to unusable peerix because of trusted-keys

    Untrusted peerix on a network can lead to unusable peerix because of trusted-keys

    If you run 3 peerix on your network and only have trusted keys on computer A to use peerix from computer B, if computer C is responding faster than B, peerix on A will report the key is untrusted and not try B.

    Basically, just add a new fast peerix service on your network and you will certainly have lot of issues about untrusted keys even if you don't want to use it.

    opened by rapenne-s 0
  • Peerix isn't handling IP change

    Peerix isn't handling IP change

    I'm using peerix on a laptop that I often connect/disconnect from ethernet, so sometimes it uses its Wi-Fi IP address, sometimes the ethernet address. However, it seems remote peerix keep the first IP seen, and if they see the ethernet, they will continue to use it, this leads to timeout from nix.

    opened by rapenne-s 0
  • Peerix doesn't serve all available files

    Peerix doesn't serve all available files

    I'm seeing a problem between my computers using peerix, files in the store are not always found

    For example, peerix reported INFO:root:Requesting kdyfy1hx3n95vifdi79zparg53r01ah3 from direct local network. when looking for kdyfy1hx3n95vifdi79zparg53r01ah3 and it didn't retrieve it from my computer 10.42.42.102 which is sometimes serving files through peerix (so peerix is working fine). On the peerix NixOS which has the file, peerix reported INFO:peerix.remote:Got request from 10.42.42.150:12304 for kdyfy1hx3n95vifdi79zparg53r01ah3

    However, I've been able to manually import it from the remote store using nix-copy-closure --from [email protected] /nix/store/kdyfy1hx3n95vifdi79zparg53r01ah3-rust-1.62.1-x86_64-unknown-linux-gnu.tar.gz to confirm the file was available in the remote store served by peerix.

    I can't find a pattern about this issue, using nix build nixpkgs#foobar.inputDerivation to pull dependencies on a system, and running it on with the same nixpkgs on another peerix computer will only download 1/5 of inputs from the peerix node. There are no specific errors in the service logs.

    opened by rapenne-s 2
Owner
null
Automatic Flask cache configuration on Heroku.

flask-heroku-cacheify Automatic Flask cache configuration on Heroku. Purpose Configuring your cache on Heroku can be a time sink. There are lots of di

Randall Degges 39 Jun 5, 2022
Python disk-backed cache (Django-compatible). Faster than Redis and Memcached. Pure-Python.

DiskCache is an Apache2 licensed disk and file backed cache library, written in pure-Python, and compatible with Django.

Grant Jenks 1.7k Jan 5, 2023
An ORM cache for Django.

Django ORMCache A cache manager mixin that provides some caching of objects for the ORM. Installation / Setup / Usage TODO Testing Run the tests with:

Educreations, Inc 15 Nov 27, 2022
A Redis cache backend for django

Redis Django Cache Backend A Redis cache backend for Django Docs can be found at http://django-redis-cache.readthedocs.org/en/latest/. Changelog 3.0.0

Sean Bleier 1k Dec 15, 2022
johnny cache django caching framework

Johnny Cache is a caching framework for django applications. It works with the django caching abstraction, but was developed specifically with the use

Jason Moiron 304 Nov 7, 2022
RecRoom Library Cache Tool

RecRoom Library Cache Tool A handy tool to deal with the Library cache file. Features Parse Library cache Remove Library cache Parsing The script pars

Jesse 5 Jul 9, 2022
Robust, highly tunable and easy-to-integrate in-memory cache solution written in pure Python, with no dependencies.

Omoide Cache Caching doesn't need to be hard anymore. With just a few lines of code Omoide Cache will instantly bring your Python services to the next

Leo Ertuna 2 Aug 14, 2022
poetry2nix turns Poetry projects into Nix derivations without the need to actually write Nix expressions

poetry2nix poetry2nix turns Poetry projects into Nix derivations without the need to actually write Nix expressions. It does so by parsing pyproject.t

Nix community projects 405 Dec 29, 2022
Minecraft.nix - Command line Minecraft launcher managed by nix

minecraft.nix Inspired by this thread, this flake contains derivations of both v

null 12 Sep 6, 2022
A Peer-to-peer Platform for Secure, Privacy-preserving, Decentralized Data Science

PyGrid is a peer-to-peer network of data owners and data scientists who can collectively train AI models using PySyft. PyGrid is also the central serv

OpenMined 615 Jan 3, 2023
Nicotine+: A graphical client for the SoulSeek peer-to-peer system

Nicotine+ Nicotine+ is a graphical client for the Soulseek peer-to-peer file sharing network. Nicotine+ aims to be a pleasant, Free and Open Source (F

null 940 Jan 3, 2023
Skepticoin is a peer-to-peer digital currency that enables you to send money online

What is Skepticoin? Skepticoin is a peer-to-peer digital currency that enables you to send money online. It's also the central community of people who

null 64 Aug 6, 2022
Django package to log request values such as device, IP address, user CPU time, system CPU time, No of queries, SQL time, no of cache calls, missing, setting data cache calls for a particular URL with a basic UI.

django-web-profiler's documentation: Introduction: django-web-profiler is a django profiling tool which logs, stores debug toolbar statistics and also

MicroPyramid 77 Oct 29, 2022
Jira-cache - Jira cache with python

Direct queries to Jira have two issues: they are sloooooow many queries are impo

John Scott 6 Oct 8, 2022
Compile Binary Ninja's HLIL IR to LLVM, for purposes of compiling it back to a binary again.

Compiles BinaryNinja's HLIL to LLVM Approach Sweep binary for global variables, create them Sweep binary for (used?) external functions, declare those

Kyle Martin 31 Nov 10, 2022
Binary++ is an esoteric programming language based on* binary

Binary++ is an esoteric programming language based on* binary. * It's meant to be based on binary, but you can write Binary++ code using different mea

Supercolbat 3 Feb 18, 2022
GoAccess is a real-time web log analyzer and interactive viewer that runs in a terminal in *nix systems or through your browser.

GoAccess What is it? GoAccess is an open source real-time web log analyzer and interactive viewer that runs in a terminal on *nix systems or through y

Gerardo O. 15.6k Jan 2, 2023
Utility functions for working with data from Nix in Python

Pynixutil - Utility functions for working with data from Nix in Python Examples Base32 encoding/decoding import pynixutil input = "v5sv61sszx301i0x6x

Tweag 11 Dec 16, 2022
Run unpatched binaries on Nix/NixOS

Run unpatched binaries on Nix/NixOS

Thiago Kenji Okada 160 Jan 8, 2023
🐤 Nix-TTS: An Incredibly Lightweight End-to-End Text-to-Speech Model via Non End-to-End Distillation

?? Nix-TTS An Incredibly Lightweight End-to-End Text-to-Speech Model via Non End-to-End Distillation Rendi Chevi, Radityo Eko Prasojo, Alham Fikri Aji

Rendi Chevi 156 Jan 9, 2023