PHPackages                             drupol/composer-plugin-nixify - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. drupol/composer-plugin-nixify

ActiveComposer-plugin

drupol/composer-plugin-nixify
=============================

Composer plugin to help with Nix packaging, temporary fork of stephank/composer-plugin-nixify

2.0.7(3y ago)22541MITPHP

Since Sep 27Pushed 1y agoCompare

[ Source](https://github.com/drupol/composer-plugin-nixify)[ Packagist](https://packagist.org/packages/drupol/composer-plugin-nixify)[ Docs](https://github.com/stephank/composer-plugin-nixify)[ RSS](/packages/drupol-composer-plugin-nixify/feed)WikiDiscussions main Synced 4w ago

READMEChangelogDependencies (4)Versions (17)Used By (1)

composer-plugin-nixify
======================

[](#composer-plugin-nixify)

Generates a [Nix](https://nixos.org) expression to build a [Composer](https://getcomposer.org) project.

- A default configure-phase that runs `composer install` in your project. (May be all that's needed to build your project.)
- A default install-phase that creates executables for you based on `"bin"` in your `composer.json`, making your package readily installable.
- Granular fetching of dependencies in Nix, speeding up rebuilds and potentially allowing downloads to be shared between projects.
- Preloading of your Composer cache into the Nix store, speeding up local `nix-build`.
- Automatically keeps your Nix expression up-to-date as you `composer require`/ `composer update` dependencies.
- **No Nix installation required** for the plugin itself, so it should be safe to add to your project even if some developers don't use Nix.

Related projects:

- [composer2nix](https://github.com/svanderburg/composer2nix): Does a similar job, but as a separate command. By comparison, this plugin tries to automate the process and make things easy for Nix and non-Nix devs alike.
- [yarn-plugin-nixify](https://github.com/stephank/yarn-plugin-nixify): Similar solution for Node.js with Yarn v2.

Usage
-----

[](#usage)

The Nixify plugin should work fine with Composer versions all the way back to 1.3.0, and also supports Composer 2.0.

To use the plugin:

```
# Install the plugin
composer require stephank/composer-plugin-nixify

# Build your project with Nix
nix-build
```

Running Composer with this plugin enabled will generate two files:

- `composer-project.nix`: This file is always overwritten, and contains a basic derivation for your project.
- `default.nix`: Only generated if it does not exist yet. This file is intended to be customized with any project-specific logic you need.

This may already build successfully! But if your project needs extra build steps, you may have to customize `default.nix` a bit. Some examples of what's possible:

```
{ pkgs ? import  { } }:

let

  # Example of providing a different source tree.
  src = pkgs.lib.cleanSource ./.;

  project = pkgs.callPackage ./composer-project.nix {

    # Example of selecting a specific version of PHP.
    php = pkgs.php74;

  } src;

in project.overrideAttrs (oldAttrs: {

  # Example of overriding the default package name taken from composer.json.
  name = "myproject";

  # Example of adding packages to the build environment.
  buildInputs = oldAttrs.buildInputs ++ [ pkgs.imagemagick ];

  # Example of invoking a build step in your project.
  buildPhase = ''
    composer run lint
  '';

})
```

Settings
--------

[](#settings)

Some additional settings are available which can be set in the `"extra"` object in your `composer.json`:

- `nix-expr-path` can be set to customize the path where the Nixify plugin writes `composer-project.nix`. For example, if you're also using [Niv](https://github.com/nmattia/niv) in your project, you may prefer to set this to `nix/composer-project.nix`.
- `generate-default-nix` can be set to `false` to disable generating a `default.nix`. This file is only generated if it doesn't exist yet, but this flag can be useful if you don't want a `default.nix` at all.
- `enable-nix-preload` can be set to `false` to disable preloading Composer cache into the Nix store. This preloading is intended to speed up a local `nix-build`, because Nix will not have to download dependencies again. Preloading does mean another copy of dependencies on disk, even if you don't do local Nix builds, but the size is usually not an issue on modern disks.

###  Health Score

32

—

LowBetter than 71% of packages

Maintenance28

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 51.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~46 days

Recently: every ~10 days

Total

15

Last Release

1411d ago

Major Versions

v1.1.0 → 2.0.02022-05-17

### Community

Maintainers

![](https://www.gravatar.com/avatar/3a5b33672e6fed2f03fee680279b6bddb884ca494237764e8c4dbb2c77e8bf05?d=identicon)[drupol](/maintainers/drupol)

---

Top Contributors

[![drupol](https://avatars.githubusercontent.com/u/252042?v=4)](https://github.com/drupol "drupol (16 commits)")[![stephank](https://avatars.githubusercontent.com/u/89950?v=4)](https://github.com/stephank "stephank (12 commits)")[![tristanpemble](https://avatars.githubusercontent.com/u/2466322?v=4)](https://github.com/tristanpemble "tristanpemble (3 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/drupol-composer-plugin-nixify/health.svg)

```
[![Health](https://phpackages.com/badges/drupol-composer-plugin-nixify/health.svg)](https://phpackages.com/packages/drupol-composer-plugin-nixify)
```

###  Alternatives

[humbug/box

Fast, zero config application bundler with PHARs.

1.3k801.5k67](/packages/humbug-box)[vaimo/composer-patches

Applies a patch from a local or remote file to any package that is part of a given composer project. Patches can be defined both on project and on package level. Optional support for patch versioning, sequencing, custom patch applier configuration and patch command for testing/troubleshooting added patches.

2994.3M14](/packages/vaimo-composer-patches)[mglaman/composer-drupal-lenient

1317.4M15](/packages/mglaman-composer-drupal-lenient)[drupal/core-composer-scaffold

A flexible Composer project scaffold builder.

5341.9M440](/packages/drupal-core-composer-scaffold)[roots/wordpress-core-installer

A Composer custom installer to handle installing WordPress as a dependency

4115.6M19](/packages/roots-wordpress-core-installer)[drupal/core-project-message

Adds a message after Composer installation.

2122.6M172](/packages/drupal-core-project-message)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
