Giter Site home page Giter Site logo

nix-serve's Introduction

nix-serve

nix-serve is a small utility to serve a Nix store as a binary cache, allowing it to be used as a substituter by other Nix installations.

Usage

The instructions below assume a flake-enabled version of Nix.

To start nix-serve, serving a binary cache on port 5000 of localhost:

# nix run github:edolstra/nix-serve

You can test whether the server works by running

# nix ping-store --store http://localhost:5000

You can then pass --substituters http://localhost:5000/ to Nix to use this binary cache as a substituter.

nix-serve user the Starman web server. See the starman documentation for additional flags you can pass, e.g.

# nix run github:edolstra/nix-serve -- --access-log /dev/stderr

Signing

It's possible to sign the binary cache. First create a key pair:

# nix-store --generate-binary-cache-key cache.example.org-1 ./secret ./public
# cat public
cache.example.org-1:l24SFecAdWV31HIN8jqFAYpCMFyreZizab3HJ3KFEgQ=

Then run the server as follows:

# NIX_SECRET_KEY_FILE=./secret nix run ...

To check whether signing and signature verification works, do:

# nix verify --store http://localhost:5000 \
    --trusted-public-keys 'cache.example.org-1:l24SFecAdWV31HIN8jqFAYpCMFyreZizab3HJ3KFEgQ=' \
    /nix/store/...

where /nix/store/... is one or more store paths served by your binary cache.

nix-serve's People

Contributors

coreyoconnor avatar edolstra avatar kwohlfahrt avatar mic92 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.