Skip to content
majkrzakPublic

About

Brings Nix reproducibility into the hostile Composer ecosystem.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nixposer

Brings Nix reproducibility into the hostile Composer ecosystem.

Important

This is a proof-of-concept implementation! The API is not yet stable and is subject to change. It should crystallize and stabilize by the 1.0.0 release. Until then, compatibility between caches generated by different nixposer versions may or may not be maintained.

The core idea behind Nixposer is to rely solely on the Nix store as a source of dependencies. This removes the burden of dealing with remote Composer repositories, especially their lack of reproducibility and the whims of third-party infrastructure.

It works by downloading each package once from a Composer repository and storing it directly in a binary cache as content-addressed NARs. This bypasses the need to create derivations and therefore simplifies things like managing third-party access credentials. On top of that, Nixposer also builds a path-based Composer repository and saves it in the same binary cache. This repository can then serve as a replacement for all previously referenced repositories, so regenerating the Composer lock file makes it point only and directly to store paths.

Usage

Nixposer is distributed as a flake. Therefore, it can be used directly by invoking nix run github:majkrzak/nixposer or brought into scope by nix shell github:majkrzak/nixposer.

Usage: nixposer [OPTIONS] <COMMAND>

Commands:
  memo   Fetch a package and save it in the Nix binary cache
  index  Index the Nix binary cache, build a Composer v2 compatible repository and save it in the binary cache
  help   Print this message or the help of the given subcommand(s)

Options:
      --store <STORE>  Nix binary cache store URL. Currently only Local Binary Cache Store is supported [default: file://.]
  -h, --help           Print help
  -V, --version        Print version

Fetch a Composer package

Fetch a package and save it in the Nix binary cache

Usage: nixposer memo [OPTIONS] <PACKAGE>

Arguments:
  <PACKAGE>  package identifier in format: foo/bar@1.2.3

Options:
      --repo <REPO>    Composer repository [default: https://repo.packagist.org]
      --store <STORE>  Nix binary cache store URL. Currently only Local Binary Cache Store is supported [default: file://.]
  -h, --help           Print help

Build a Composer repository

Index the Nix binary cache, build a Composer v2 compatible repository and save it in the binary cache

Usage: nixposer index [OPTIONS]

Options:
      --store <STORE>  Nix binary cache store URL. Currently only Local Binary Cache Store is supported [default: file://.]
  -h, --help           Print help

About

Brings Nix reproducibility into the hostile Composer ecosystem.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages