Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/edolstra/nix-serve
A standalone Nix binary cache server
https://github.com/edolstra/nix-serve
Last synced: 18 days ago
JSON representation
A standalone Nix binary cache server
- Host: GitHub
- URL: https://github.com/edolstra/nix-serve
- Owner: edolstra
- License: lgpl-2.1
- Created: 2013-07-04T10:49:16.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2024-08-02T07:06:21.000Z (4 months ago)
- Last Synced: 2024-08-03T01:38:24.675Z (4 months ago)
- Language: Perl
- Size: 56.6 KB
- Stars: 156
- Watchers: 9
- Forks: 36
- Open Issues: 20
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
README
# 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 store ping --store http://localhost:5000
```You can then pass `--substituters http://localhost:5000/` to Nix to
use this binary cache as a substituter.`nix-serve` uses the Starman web server. See the [`starman`
documentation](https://metacpan.org/pod/distribution/Starman/script/starman)
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.